PDA

View Full Version : Filterfunction problem



Roel Westhoff [W4]
6-Jun-2010, 01:27 AM
Hello Daw (Vincent),

We are using VRW RCIII with vdf15.1

We have a problem with the filterfunction. Something strange is happening and i can't find anything wrong. We are in process of implementing VRW in our new app.

The report is on a single flat-file with the fields (ACCNT.ADMPO, ACCNT.ADMPRJ,ACCNT.ADMNR,ACCNT.ACCNTNR,ACCNT.DESCR IPTION). The database is Pervasive9.5.

The indexing is
Index.1 ACCNT.OVERLAPADM (ADMPO+ADMPRJ+ADMNR)
ACCNT.ACCNTNR
Index.2 ACCNT.OVERLAPADM (ADMPO+ADMPRJ+ADMNR)
ACCNT.ACCNTNR
Index.3 ACCNT.ADMPO
ACCNT.ADMPRJ
ACCNT.ADMNR
ACCNT.ACCNTNR

The below filterfunction does work but if delete the comments no filtering is executed

// Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{ACCNT.ADMPO} = " + //String (trim(sAdmpo)) + "") to sFilterFunction
Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{ACCNT.ADMPRJ} = " + String (trim(sAdmprj)) + "") to sFilterFunction
Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{ACCNT.ADMNR} = " + String (trim(iAdmnr)) + "") to sFilterFunction
If (sFromAccntnr <> "") Begin
Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{ACCNT.ACCNTNR} >= " + String ((trim(sFromAccntnr))) + "") to sFilterFunction
End
If (sToAccntnr <> "") Begin
Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{ACCNT.ACCNTNR} <= " + String ((trim(sToAccntnr))) + "") to sFilterFunction
End

Can you explain why i encounter this problem. Is this a bug?

Roel

Vincent Oorsprong
7-Jun-2010, 03:20 AM
Roel,

What happens when you put the same filter in a function in the report, hardcoded thus? Does it fail too?

What datatype do the fields have? I see you compare all with strings? Are they strings?

You write "no filtering is executed"; does that mean ALL records are returned or NONE, or the WRONG ones.

Roel Westhoff [W4]
7-Jun-2010, 05:26 AM
Vincent,

I've added the Filterstring directly and all the records are presented.
So no filtering means that all records are displayed

I've also added Cstr or Cint to the filterstring without no result.

Roel

Vincent Oorsprong
7-Jun-2010, 02:52 PM
Roel,

Is is possible to get the database layout and the report? Please send it to support@dataaccess.eu and we will look into it.

Roel Westhoff [W4]
9-Jun-2010, 10:41 AM
Hello Vincent,

I looked at the wizard output and solved the problem
The below code works

Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{ACCNT.ADMPO} >= CStr (" + '"' + trim(sAdmpo) + '"' + ")") to sFilterFunction
Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{ACCNT.ADMPRJ} >= CStr (" + '"' + trim(sAdmprj) + '"' + ")") to sFilterFunction
Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{ACCNT.ADMNR} >= Cint (" + (String(iAdmnr)) + ")") to sFilterFunction
If (sFromAccntnr <> "") Begin
Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{ACCNT.ACCNTNR} >= Cstr (" + '"' + trim(sFromAccntnr) + '"' + ")") to sFilterFunction
End
If (sToAccntnr <> "") Begin
Move (sFilterFunction + (If (sFilterFunction <> "", " and ", "")) + "{ACCNT.ACCNTNR} <= Cstr (" + '"' + trim(sToAccntnr) + '"' + ")") to sFilterFunction
End

Thanks for the hint

Roel