on 01-25-2018 7:00 AM
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
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.Update();
btnRecordSelectionForm.AppendText("\n\n");
btnRecordSelectionForm.Update();
btnRecordSelectionForm.AppendText("\n\nWithout Comments:\n" + rpt.RecordSelectionFormula.ToString());
btnRecordSelectionForm.Update();
//myRecordSelectionWithComments.FreeEditingText = "{TStat.TArt_Cod} = \"A823/001\"";
//rpt.RecordSelectionFormula = "{TStat.TArt_Cod} = \"A823/001\"";
//IsRpt = false;
}
else
btnRecordSelectionForm.Text = "No Record Selection formula";
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.