To set a parameter value for a parameter field in sub-report of a Crystal Report you may have to use the function
SetParameterValue(string parameterFieldName, object value, string subreport)
First create a ReportDocument object for main report and pass the parameter values to main report and subreports, for instance,mainrpt = new ReportDocument(); ReportViewer.Enabled = true; mainrpt.SetParameterValue("@ClmId", CLMID);
// main report parammainrpt.SetParameterValue("@Param1", ParamValue,"SubReport1.rpt");
//subreport parammainrpt.SetParameterValue("@Param1", ParamValue,"SubReport2.rpt"); //subreport param ReportViewer.ReportSource = mainrpt; ReportViewer.Visible = true;
No comments:
Post a Comment