Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runtime set formulas to Crystal Reports 9

Status
Not open for further replies.

zlatinas

Programmer
Aug 11, 2004
1
BG
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;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top