Skip to Content
author's profile photo Former Member
Former Member

Record selection Formula value is vanishing with Crystal run time 13.0.20


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();


//set mainselection formula


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


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

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

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



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jan 25, 2018 at 06:53 PM

    Not sure why you are using those but try this:

    // Record selection formula with comments included can only be retrieve via RAS
    //rpt.RecordSelectionFormula = "if not isnull({CUSTOMER.Customer Credit ID}) then {CUSTOMER.Customer Credit ID} = {%test} else true";
    CrystalDecisions.ReportAppServer.DataDefModel.ISCRFilter myRecordSelectionWithComments; // = new CrystalDecisions.ReportAppServer.DataDefModel.;
    myRecordSelectionWithComments = rptClientDoc.DataDefController.DataDefinition.RecordFilter;
    if (myRecordSelectionWithComments.FreeEditingText != null)
    //myRecordSelectionWithComments.FreeEditingText = rptClientDoc.DataDefController.RecordFilterController.GetFormulaText();
    btnRecordSelectionForm.Text = "\nWith Comments:\n" + myRecordSelectionWithComments.FreeEditingText.ToString();
    btnRecordSelectionForm.AppendText("\n\nWithout Comments:\n" + rpt.RecordSelectionFormula.ToString());
    //myRecordSelectionWithComments.FreeEditingText = "{TStat.TArt_Cod} = \"A823/001\"";
    //rpt.RecordSelectionFormula = "{TStat.TArt_Cod} = \"A823/001\"";
    //IsRpt = false;
    btnRecordSelectionForm.Text = "No Record Selection formula";


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.