We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon
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.

Bold ReportViewer - Viewing an SSRS report on an SSRS Server in Blazor

Hi

What I am doing I think is fairly simple, but I am struggling to find how to do it.  I would like to use the Bold ReportViewer in a Blazor Server page.  However, rather than exporting the RDL file to the Blazor website and referencing the RDL file from there, is it possible to run and view the SSRS report directly from our SQL Server.  Also if possible I would like to be able to send parameters to the report from controls in the Blazor page.

There seem to be ways to do this with the javascript control but I cannot find how to integrate this within a Blazor page.  Are there any examples?

Regards

Martin



6 Replies

AM Arumugasami Murugesan Syncfusion Team March 2, 2022 12:02 PM UTC

Hi Martin, 
 
Thanks for the update, 
 
Yes, it is possible to run and view the report on the SSRS server directly from our SQL Server. Please refer to the below documentation. 
https://help.boldreports.com/embedded-reporting/aspnet-core-reporting/report-viewer/ssrs-report/ 
We can pass the parameters to the control from blazor page as show in the below snap. Please find the sample link below for your reference  
 
 
 

Please refer to the below documentation for the supported version of SSRS.
https://help.boldreports.com/embedded-reporting/faq/ssrs-supported-versions-in-bold-reports/
 
 
Regards 
Arumugasami M 



PA Paolo May 2, 2022 11:26 AM UTC

Hi Arumugasami,

something it's not clear to me. As per provided examples, there is no way to connect to a SSRS server, because the relevant service API method refers to a RDL file saved in wwwroot static files.

I mean this method from service API:

public void OnInitReportOptions(ReportViewerOptions reportOption)

where I find

FileStream fileStream = new FileStream(basePath + @"\Report\"+ reportOption.ReportModel.ReportPath + ".rdl",

                                                    FileMode.Open, FileAccess.Read);

So, how may I pass the SSRS serverURL (i.e. https://mydomain/ReportServer)? As well as folder name and report name? Is it a FileStream, in this scenario, the right .NET object to use?

The BoldReportViewerOptions, inside razor component page, has no properties regarding SSRS server URL.

It should be excellent to have an example regarding a SSRS server, not a RDL local file.

Thank You

Paolo



AM Arumugasami Murugesan Syncfusion Team May 4, 2022 06:39 AM UTC

Hi Martin,


Thanks for the update,


Bold Reports report viewer has support for loading RDL reports from SSRS Report Server. You need to pass the ReportServerUrl and report name as shown in the below code snippet. We have prepared a sample application in Blazor application and attached it.

public void OnInitReportOptions(ReportViewerOptions reportOption)

{

   reportOption.ReportModel.ReportServerUrl = http://synclapn24026/ReportServer;

   reportOption.ReportModel.ReportPath = "/SSRS";

}


Please refer to the below documentation for your reference.
https://help.boldreports.com/embedded-reporting/aspnet-core-reporting/report-viewer/ssrs-report/


Regards,

Arumugasami M


Attachment: Blazor_server_App_597f88bc.zip


PA Paolo May 5, 2022 10:27 AM UTC

Hi Arumugasami,

thank you for providing code. Well, it works... but I get a problem:

I consume the Report Service from Blazor Server App. But I create the relevant controller in an existing REST API, because the Blazor App already consume other API methods. Is this approach possible, or the Report Service Controller has to be included in Blazor Server App project (as per your example)?

Is it possible to have some more details regarding the reported failure? So I could fix it...

Thank you

Paolo



PA Paolo May 5, 2022 11:02 AM UTC

Hi Arumugasami,

moving the API controller into the Blazor Server App project, I fixed the problem. So, is it not possible to connect to an external REST API?

Anyway I need to change the code in the controller method OnInitReportOptions, because the report name, set in the razor component page, it's not passed into the controller. Only hard coding the following lines, I am able to see the report:

reportOption.ReportModel.ReportPath = _config.GetValue<string>("SSRS:ReportPath") + "/UsciteCasaPerMese"; (this last is the report name, the configuration value is the path

In this way I cannot launch more than 1 report.... any solution?

Best regards

Paolo



AM Arumugasami Murugesan Syncfusion Team May 6, 2022 10:46 AM UTC

Hi Paolo,


Thanks for the update,


Please find the details from the below table,


Query

Response

moving the API controller into the Blazor Server App project, I fixed the problem. So, is it not possible to connect to an external REST API?

 

Yes, It is possible to connect to an external REST API. Please refer to the below documentation for your reference.

https://help.boldreports.com/embedded-reporting/aspnet-core-reporting/report-designer/designer-guide/manage-data/data-connectors/rest-api-data-source/

https://help.boldreports.com/embedded-reporting/how-to/configure-webapi-data-extension-for-report-viewer/

Anyway I need to change the code in the controller method OnInitReportOptions, because the report name, set in the razor component page, it's not passed into the controller. Only hard coding the following lines, I am able to see the report:

reportOption.ReportModel.ReportPath = _config.GetValue<string>("SSRS:ReportPath") + "/UsciteCasaPerMese"; (this last is the report name, the configuration value is the path

 

If you want to change the report name in the controller file, you need to use the below code snippet as shown in the below snap.

boldreports-interop.js

Controller

In this way I cannot launch more than 1 report.... any solution?

 

Yes, you can create more than one report. You need to create one main report and follow it up with sub-reports. Please refer to the below documentation to design the rdl report using the sub report.

https://help.boldreports.com/embedded-reporting/blazor-reporting/report-designer/designer-guide/report-items/subreport/design-rdl-report-using-subreport/

Please refer to the below documentation for your reference.

https://help.boldreports.com/embedded-reporting/blazor-reporting/report-viewer/add-report-viewer-to-a-blazor-application/


Regards,

Arumugasami M


Loader.
Live Chat Icon For mobile
Up arrow icon