Search results

Load SSRS RDL reports

The Report Viewer supports loading RDL reports from the SSRS Report Server.

Pure .Net Core project will support only SSRS 2017 server. The ASP.NET Core project with the combination .NET framework will render report from all SSRS server versions.

To render SSRS Reports, set the report-server-url, report-path, and report-service-url properties as shown in the following code snippet.

    <sf-report-viewer id="viewer" report-service-url="/api/ReportViewer" processing-mode="Remote" report-server-url="http://mvc.syncfusion.com/ReportServer" report-path="/SSRSSamples2/Territory Sales New">
    </sf-report-viewer>

Report Server URL should be in the format of http://<servername>/reportserver$instanceName The report path should be in the format of “/folder name/report name”.

Network credentials for SSRS

The network credentials are required to load specified SSRS report from the specified SSRS Report Server using the Report Viewer. Specify the ReportServerCredential property in the Web API Controller OnInitReportOptions method.

public void OnInitReportOptions(ReportViewerOptions reportOption)
{
    //Add SSRS Report Server credential
    reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("ssrs", "RDLReport1");
}

Set data source credential to shared data sources

The SSRS Report Server does not provide options to get credential information of the report data source deployed on the SSRS Server. If the report has any data source that uses credentials to connect with the database, then you should specify the DataSourceCredentials for each report data source to establish database connection.

public void OnInitReportOptions(ReportViewerOptions reportOption)
{
    //Add SSRS Report Server and data source credentials
    reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("ssrs", "RDLReport1");

    reportOption.ReportModel.DataSourceCredentials.Add(new Syncfusion.Reporting.Web.DataSourceCredentials("AdventureWorks", "demoreadonly@data-platform-demo", "N@c)=Y8s*1&dh"));
}

Data source credentials should be added to the shared data sources that do not have credentials in the connection strings.

Change data source connection string

You can change the connection string of a report data source before it is loaded in the Report Viewer. The DataSourceCredentials class provides the option to set and update the modified connection string as in the following code snippet.

        public void OnInitReportOptions(ReportViewerOptions reportOption)
        {
            reportOption.ReportModel.DataSourceCredentials.Add(new Syncfusion.Reporting.Web.DataSourceCredentials("AdventureWorks", "demoreadonly@data-platform-demo","N@c)=Y8s*1&dh","Data Source=dataplatformdemodata.syncfusion.com;Initial Catalog=AdventureWorks;"));
        }

The previous code shows an option to change the connection string only, but the class provides multiple options to change data source information. To learn more about this, refer to the DataSourceCredentials class.

Render linked reports

You can render a linked report that points to an existing report, which is published in the SSRS Report Server. You can set the parameter, data source, credential, and other properties like normal SSRS reports using the Report Viewer.

    <sf-report-viewer id="viewer" report-service-url="/api/ReportViewer" processing-mode="Remote" report-server-url="http://mvc.syncfusion.com/ReportServer" report-path="/SSRSSamples/Territory Sales_Link">
    </sf-report-viewer>

The Territory Sales_Link is a linked report created for the Territory Sales report that is already available in the SSRS Report Server.