Search results

Load SharePoint Integrated Reports

To render SharePoint integrated SSRS reports, set the reportServerUrl, reportPath and reportServiceUrl properties as shown in the following code snippet.

<ej-reportviewer id="reportViewer_Control" [reportServiceUrl] = "serviceUrl" [processingMode] = "Remote" [reportServerUrl] = "serverUrl" [reportPath] = "reportPath">
</ej-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://reports.syncfusion.com/demos/services/api/ReportViewer';
        this.serverUrl = 'http://mvc.syncfusion.com/dev_report/reportserver';
        this.reportPath = 'http://mvc.syncfusion.com/dev_report/SSRSSamples/Territory Sales.rdl';
    }
}

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

Forms credential for SharePoint server

The Forms credentials are required to connect with the specified SharePoint integrated SSRS Report Server using the Report Viewer. Specify the ReportServerFormsCredential property in the Web API Controller OnInitReportOptions method.

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

Set data source credential for shared data sources

The shared data source credentials can be added to the DataSourceCredentials property to connect with the database.

public void OnInitReportOptions(ReportViewerOptions reportOption)
{
    //Add ReportServerFormsCredential and data source credentials
    reportOption.ReportModel.ReportServerFormsCredential = new Syncfusion.Reporting.Web.ReportServerFormsCredential("ssrs", "RDLReport1");
    reportOption.ReportModel.DataSourceCredentials.Add(new Syncfusion.Reporting.Web.DataSourceCredentials("AdventureWorks", "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.