0
votes

I am developing software in asp.net c#, in that it have a Crystal Reports & also Crystal Reports has a sub report in it..

I load only main report through pass the value of bolReports.Year,

The problem is: I can't load sub report using the same parameter..

When I run the page means it ask parameter to sub reports..

Anyone help, thanks in advance..

DataSet ds = new DataSet("tbl");
ReportDocument cryRptDoc = new ReportDocument();
string ReportPath = string.Empty;

bolReports.Year = ddlYear.SelectedValue.Trim();

ReportPath = Server.MapPath("~\\Reports\\PerCallBrnMon.rpt");
cryRptDoc.Load(ReportPath);
cryRptDoc.SetDatabaseLogon(bolReports.UserID, bolReports.Password, bolReports.ServerName, bolReports.DataBaseName);
ds = bolReports.sp_CallClosing();
cryRptDoc.SetDataSource(ds.Tables[0]);

CrystalReportViewer1.ReportSource = cryRptDoc;
CrystalReportViewer1.DataBind();

CrystalReportViewer1.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None;
CrystalReportViewer1.HasExportButton = false;
CrystalReportViewer1.HasPrintButton = false;
CrystalReportViewer1.Zoom(80);

Main Report Name : PerCallBrnMon.rpt

Sub Report Name : PerCallBrnMonGrp.rpt

Error :

enter image description here

Watch this..

enter image description here

In this code, I have run only main report & main report stored procedure, & I don't know how to run sub report & sub report stored procedure.. the main report has a sub report in it, & both having the same parameter of bolReports.Year..

1

1 Answers

0
votes

In the template add the links between the main report and the subreport. It should be available in one of the options in the context menu of the subreport.