public void OnReportLoaded(ReportViewerOptions reportOption)
{
if (reportOption.SubReportModel != null)
{
reportOption.SubReportModel.DataSources = new ReportDataSourceCollection();
//reportOption.SubReportModel.DataSources.Add(new ReportDataSource { Name = "<Dataset Name>", Value = <Data collection> });
reportOption.SubReportModel.DataSources.Add(new ReportDataSource { Name = "DataSet1", Value = SubReport.GetData() });
}
} |
public void OnReportLoaded(ReportViewerOptions reportOption)
{
if (reportOption.SubReportModel != null)
{
var parameters = new List<Syncfusion.Report.ReportParameter>();
Syncfusion.Report.ReportParameter reportParameter = new Syncfusion.Report.ReportParameter();
reportParameter.Name = "InvoiceID";
reportParameter.Values.Add("10253");
reportParameter.Labels.Add("10253");
parameters.Add(reportParameter);
if (parameters != null && parameters.Count > 0)
{
reportOption.SubReportModel.DataSources = new ReportDataSourceCollection();
reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "StoreSales", Value = StoreSales.GetData(Convert.ToInt32(parameters[0].Values[0])) });
}
}
} |