Wednesday, March 28, 2012

ReplaceSelectionFormula not working at all?

I have a VB6 / Crystal 7 app that is coded exactly like many others I have written. For some reason, this app will not pass anything through the "ReplaceSelectionFormula" method. I dont know if something is wrong with the RPT files, or the database, or what?

I will attached a TXT file of the code that calls the report, and the RPT file itself.

The behavior is the same for all 10 or so reports in the app???

Please help. thanks!i m using the the syntax ...
rpt.ReplaceSelectionFormula = "{tbl.field} = id" ...
and its working fine try this ...
hope this will work .. u missed equal to singn (=) before passing 'w' string to replaceSelectionFormula .. this may be error ...
..
mdiMain.CrystalReport1.ReportTitle = sl_short
mdiMain.CrystalReport1.ReplaceSelectionFormula w
************** w is usually equal to something like "{V_SCORE_BY_YEARMONTH.ResponseYear}=2007" *************

..|||When i use the symtax you recommened:

mdiMain.CrystalReport1.ReplaceSelectionFormula = w

I get an "Argument not optional" error.

It is working for me without the "=" is several other applications.

No comments:

Post a Comment