How to render SSRS reports?
You need to set the reportServerUrl
details as shown in the below code snippet to connect with the SSRS
server.
You can find the Web Service URL from the Reporting Services Configuration Manager under the Web Service URL
section.
You need to set the reportPath
, and it should be in the format of /folder name/report name
.
<script type="text/javascript">
$(function () {
$("#viewer").boldReportViewer({
reportServiceUrl: "/api/SSRSReports",
reportPath: "/BoldReports/Territory Sales",
reportServerUrl: "http://<servername>/Reports_SSRS"
});
});
</script>
You need to set ReportServerCredential
in the Web API Controller OnInitReportOptions
method, as shown in the below snippet to connect SSRS
server.
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("ssrs", "RDLReport1");
}
If the report has any data source that uses credentials, you must specify the DataSourceCredentials
in the Web API Controller OnInitReportOptions
method as shown in the below snippet to connect datasource
.
reportOption.ReportModel.DataSourceCredentials.Add(new BoldReports.Web.DataSourceCredentials("AdventureWorks", "ssrs1", "RDLReport1"));
For more details, refer to the below help link. https://help.boldreports.com/embedded-reporting/javascript-reporting/report-viewer/ssrs-report/