how to change values of Crystal Reports in vc# 2005?
-
hi i created a report in my solution with crystalreport for print my datagridview's records, and i add a date object to Crystalreport designer that show date in my report. but i want to change this vlaue in my app programmatically, but how to change it from my code ? thanks .
-
hi i created a report in my solution with crystalreport for print my datagridview's records, and i add a date object to Crystalreport designer that show date in my report. but i want to change this vlaue in my app programmatically, but how to change it from my code ? thanks .
Create a parameter field for the date. When you create the report object, use the ParameterFields Collection of the ReportDocument to find your paramter. Set it using the .CurrentValues.Add property of the ParameterField. ReportDocument report = new ReportDocument(); report.Load(@"MyReportFile.rpt"); foreach(ParameterField field in report.ParameterFields) { if(field.ParameterFieldName == "MyName") { field.CurrentValues.Add(MyDateValue); } }