Using Subreport in Crystal Report and ASP.NET C# -
my main report , subreport similar each other, using same parameters , formula difference order in derails section. when load subreport in report , run it, asp.net keeps on asking enter values parameters used.
i think need have code loads subreport.
protected void page_load(object sender, eventargs e) { report.load(server.mappath("monthlysalesreportp.rpt")); report.setdatabaselogon ("sa", "pw", @"databasename, "servername"); crystalreportviewer1.reportsource = report; crystalreportviewer1.reuseparametervaluesonrefresh = true; crystalreportviewer1.databind(); crystalreportviewer1.separatepages = false; report.setparametervalue(0, monthlastyear); report.setparametervalue(1, monthcurrent); report.setparametervalue(2, monthprevious); report.setparametervalue(3, rp); report.setparametervalue(4, loc); report.setparametervalue(5, cms); report.setparametervalue(6, yearcurrent); report.setparametervalue(7, yearprevious); report.setparametervalue(8, yearlastyear); report.setparametervalue(9, fullname); }
should include code needed read subreport?
i see suggestion
report.setdatasource(dtproductview); report.subreports[0].setdatasource(dsheader.tables[0]); report.subreports[1].setdatasource(dsfooter.tables[0]);
but not have datatable or dataset, directly stored procedure
have tried linking parameters of subreport main report?
(
change subreport links
in subreport context menu)you can try, also:
report.subreports[0].setparametervalue(0, monthlastyear);
Comments
Post a Comment