Problem with using ParameterField class in CrystalReport.
-
hi i want create ParameterField class in my app but i don't found it in crystalreport NameSpace, where it ? and ReportDocument does not have a ParameterFields property. Here is Code : ReportDocument report = new ReportDocument(); report.Load(@"MyReportFile.rpt"); //i could not create ParameterField because i don't found it in crystal report namespace foreach(ParameterField field in report.ParameterFields) { if(field.ParameterFieldName == "MyName") { field.CurrentValues.Add(MyDateValue); } }
-
hi i want create ParameterField class in my app but i don't found it in crystalreport NameSpace, where it ? and ReportDocument does not have a ParameterFields property. Here is Code : ReportDocument report = new ReportDocument(); report.Load(@"MyReportFile.rpt"); //i could not create ParameterField because i don't found it in crystal report namespace foreach(ParameterField field in report.ParameterFields) { if(field.ParameterFieldName == "MyName") { field.CurrentValues.Add(MyDateValue); } }
Make sure you are using the right namespaces. I have the following using statements in my sample
using CrystalDecisions.CrystalReports.Engine ; using CrystalDecisions.Shared ; using CrystalDecisions.Windows.Forms ;
Also, make certain you are referencing the right assemblies. The following are ref's in my projectCrystalDecisions.CrystalReports.Engine CrystalDecisions.ReportSource CrystalDecisions.Shared CrystalDecisions.Windows.Forms
The full path/classes areCrystalDecisions.CrystalReports.Engine.ReportDocument CrystalDecisions.Shared.ParameterField
The sample I sent you works with Crystal Reports XI R2, but was the same in CR X.