Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146270 | Jul 29,2019 10:21 AM UTC | Jul 29,2019 02:28 PM UTC | Report Platform | 3 |
![]() |
Tags: Report Viewer |
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])) });
}
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.