Articles in this section
Category / Section

How to render the SSRS report with ReactJS and ASP.NET Core API

1 min read

The Syncfusion ReactJS ReportViewer has a support to render the SSRS report.

 

Refer to the following documentation link to create a ReportViewer sample in ReactJS.

 Getting Started documentation.

 

Refer to the following documentation link to create a Web API service sample in ASP.NET Core application.

Getting Started documentation.

 

You should pass the SSRS Report Server URL and credentials to retrieve athe report from the SSRS Server in the ReportViewer.

 

Client-side processing

The following code snippet demonstrates how to pass a Server URL and report path in ReactJS.

 

ReportViewer.jsx

ReactDOM.render( 
    <EJ.ReportViewer id="territoryReportViewer" 
                     reportserviceurl={ 'api/ReportApi' } 
                     reportserverurl={'http://localhost/ReportServer'} 
                     processingmode={"remote"} 
                     reportpath={"/CustomerTesting"}> 
    </EJ.ReportViewer>, 
    document.getElementById('container') 
); 

 

Server-side processing

The following code snippet demonstrates how to pass the server credentials. If you use data source with credentials in the designed report, then you should pass the credentials for data source at server-side.

HomeController.cs

        public void OnInitReportOptions(Syncfusion.EJ.ReportViewer.ReportViewerOptions reportOption) 
        { 
            //Adds SSRS Server and Database Credentials here. 
            //reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("<pass Server username>", "<pass password>"); 
            reportOption.ReportModel.ReportServerCredential = newSystem.Net.NetworkCredential("testing", "testing@123"); 
            //reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials("<pass Datasource name>", "<pass User name>", "<pass password>")); 
            reportOption.ReportModel.DataSourceCredentials.Add(newDataSourceCredentials("FADatasource", "sa", "test@123")); 
        } 

 

You can download the sample from the following location.

Sample  

https://www.syncfusion.com/downloads/support/directtrac/general/ze/ASPNETCoreReactNET-Example7609551921415739800.zip 

 

Note:

In the above sample, our local SSRS Server URL, credentials, and report path are used. So, you could change your SSRS Server URL, credentials, and report path to retrieve a report from the SSRS Server.

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please  to leave a comment
Access denied
Access denied