I have problems with runtime set groups in report and subreports (CR9). My case is the following:
I have main report with 9 subreports. Every subreport needs different table from SQL DB.
I have 4 groups in the main report and in each subreport all of them with the same identifical name.
Every group contains formula, with text generated from source code and user interface.
But formulas in crystal reports is empty (null). How to solve this problem? Can you help me.
I set formula text in C# as:
FieldDefinition Field1;
ReportDocument repDocs = new ReportDocument();
repDocs.Load(reportName);
repDocs.DataDefinition.FormulaFields[formulaName].Text = "{TableName.FieldName}";
if (!repDocs.DataDefinition.FormulaFields[formulaName].Check(ref sERR))
MessageBox.Show(sERR); --> all is OK
Field1 = repDocs.Database.Tables[TableName].Fields[FieldName];
repDocs.DataDefinition.Groups[0].ConditionField = Field1; --> all i OK
crystalReportViewer.ReportSource = reportName;
Show;
I have main report with 9 subreports. Every subreport needs different table from SQL DB.
I have 4 groups in the main report and in each subreport all of them with the same identifical name.
Every group contains formula, with text generated from source code and user interface.
But formulas in crystal reports is empty (null). How to solve this problem? Can you help me.
I set formula text in C# as:
FieldDefinition Field1;
ReportDocument repDocs = new ReportDocument();
repDocs.Load(reportName);
repDocs.DataDefinition.FormulaFields[formulaName].Text = "{TableName.FieldName}";
if (!repDocs.DataDefinition.FormulaFields[formulaName].Check(ref sERR))
MessageBox.Show(sERR); --> all is OK
Field1 = repDocs.Database.Tables[TableName].Fields[FieldName];
repDocs.DataDefinition.Groups[0].ConditionField = Field1; --> all i OK
crystalReportViewer.ReportSource = reportName;
Show;