Skip to Content
0
Former Member
Jan 25, 2018 at 07:00 AM

Record selection Formula value is vanishing with Crystal run time 13.0.20

85 Views

Hi,

While executing below code record selection formula value is always vanished after jumping into next code line.

I am checking Record selection formula length in code line:4 then jump into inside If condition. when i come to code line 8 It's not showing any value for Record selection formula but I can see value for RecordSelectionFormulaRaw and reportobject.MainSelectionFormula.

Why the value is vanished after code line : 4. Any suggestion?

Record selection formula: ({Form.FM_Kind}=1)

Code class:

//load report

1.mainreportdoc = new ReportDocument();

2.mainreportdoc.Load(reportobject.ReportPath);

//set mainselection formula

3.reportobject.Finalize_MainSelectionFormula();

4.if (mainreportdoc.RecordSelectionFormula.Length > 0)

5.{

6.mainreportdoc.DataDefinition.RecordSelectionFormula = "(" + mainreportdoc.DataDefinition.RecordSelectionFormulaRaw + ")";

7.if (reportobject.MainSelectionFormula != null && reportobject.MainSelectionFormula != "")

8.mainreportdoc.RecordSelectionFormula = mainreportdoc.DataDefinition.RecordSelectionFormulaRaw + " and " + reportobject.MainSelectionFormula; }

Thanks,

Sakshi