Posted 13 May 2020, 5:01 pm EST
I would like filter data I set to subreport based on ReportParameter Values of Subreport. My question is how do I access subreport parameter values through LocateDataSourceEventArgs type.
var data = await _someService.Get(id);
string rptPath = HostingEnvironment.MapPath("/Reports/MainRpt.rdlx");
GrapeCity.ActiveReports.PageReport rpt = new GrapeCity.ActiveReports.PageReport();
rpt.Load(new System.IO.FileInfo(rptPath));
//PesoCodeRpt rpt = new PesoCodeRpt();
GrapeCity.ActiveReports.Document.PageDocument myDocument = new GrapeCity.ActiveReports.Document.PageDocument(rpt);
Subreport subreport = (Subreport)((List)rpt.Report.Body.ReportItems["List1"]).ReportItems["Subreport1"];
subreport.ReportName = Path.GetFullPath(HostingEnvironment.MapPath("/Reports/SubRpt.rdlx"));
myDocument.LocateDataSource += new LocateDataSourceEventHandler((object sender, GrapeCity.ActiveReports.LocateDataSourceEventArgs args) =>
{
var x = args.Report.Name;
if (args.Report.Name.Contains("SubRpt.rdlx"))
{
var paramss = args.Report.ReportParameters;
}
else
{
args.Data = data;
}
});
thank you for your prompt response.