Load SharePoint Server reports

To render SharePoint Server reports in the Bold Reports® Angular Report Viewer, set the reportServerUrl, reportPath, and reportServiceUrl properties, as in the following code snippet:

<bold-reportviewer id="reportViewer_Control" [reportServiceUrl] = "serviceUrl" [processingMode] = "Remote" [reportServerUrl] = "serverUrl" [reportPath] = "reportPath">
</bold-reportviewer>
import { Component } from '@angular/core';

@Component({
    selector: 'ej-app',
    templateUrl: 'src/reportviewer/reportviewer.component.html',
    styleUrls: ['src/reportviewer/reportviewer.component.css']
})

export class ReportViewerComponent {
    public serviceUrl: string;
    public reportPath: string;
    public serverUrl: string;

    constructor() {
        this.serviceUrl = 'https://demos.boldreports.com/services/api/ReportViewer';
        this.serverUrl = 'http://<servername>/reportserver$instanceName';
        this.reportPath = 'http://<servername>/reportserver$instanceName/SSRSSamples/Territory Sales.rdl';
    }
}

In SharePoint integrated mode, the reportServerUrl will be same as your site URL. The reportPath is relative to the Bold Reports® Report Server URL with the file extension.

How do I set forms credentials for SharePoint Server?

To set forms credentials for a SharePoint integrated SSRS Report Server, specify the ReportServerFormsCredential property in the Web API Controller OnInitReportOptions method. The Angular Report Viewer requires the forms credentials to connect with that server.

[NonAction]
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
    //Add ReportServerFormsCredential for server
    reportOption.ReportModel.ReportServerFormsCredential = new BoldReports.Web.ReportServerFormsCredential("ssrs", "RDLReport1");
}

How do I set data source credentials for shared data sources?

To connect shared data sources with the database, add their credentials to the DataSourceCredentials property in the Angular Report Viewer Web API controller.

[NonAction]
public void OnInitReportOptions(ReportViewerOptions reportOption)
{
    //Add ReportServerFormsCredential and data source credentials
    reportOption.ReportModel.ReportServerFormsCredential = new BoldReports.Web.ReportServerFormsCredential("ssrs", "RDLReport1");
    reportOption.ReportModel.DataSourceCredentials.Add(new BoldReports.Web.DataSourceCredentials("<database>", "ssrs1", "RDLReport1"));
}

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

Build and run the application.

See also