If you became a customer of the Syncfusion� Reporting Platform or the Report Viewer, Report Designer, or Report Writer components before October 2019 and have questions related to those products, you can request support through our forum system. However, please note that this support system is only for existing customers who are still using the Syncfusion� Reporting Platform or its components and not for new customers looking for reporting products from Syncfusion�.

For new customers or those with general reporting questions, we recommend contacting our support team at https://support.boldreports.com/, which is a separate brand created by Syncfusion� for its reporting solutions. Our team will be happy to assist you with any questions you may have.

Thank you for choosing Syncfusion� for your reporting needs.

Pass report datasource to ReportViewer component

Hello,
I want to build a reusable Blazor component with the bold report viewer but I don't get how I can pass Generic types datasource to the reports api controller.

Following the example I see the datasource is set in the OnInitReportOptions() function, how can I pass different datasource to it without having to create a different controller for every report ?

Thanks





1 Reply 1 reply marked as answer

MR Manoranjan Rajendran Syncfusion Team June 1, 2021 05:31 AM UTC

Hi Lorenzo,   
  
Thanks for contacting Bold Reports support.   
  
If you want to pass different datasource for report, please add the datasource based on the report name. Please refer below code snippet for this.  
  
Code snippet:  
if( reportOption.ReportModel.ReportName=="SalesReport")   
  {   
    reportOption.ReportModel.DataSources.Add(new BoldReports.Web.ReportDataSource { Name = "list", Value = ProductList.GetData() });   
  }   
 else if(reportOption.ReportModel.ReportName == "ProductReport")   
   {   
    reportOption.ReportModel.DataSources.Add(new BoldReports.Web.ReportDataSource { Name = "product", Value = product.GetData() });   
   }   
  
Regards,   
Manoranjan R   


Marked as answer
Loader.
Up arrow icon