Load SharePoint Server reports

To render SharePoint Server reports in the Bold Reports® UWP Report Viewer, set the ReportPath, ReportServiceURL, ReportServerUrl and ReportServerFormsCredential properties as in the following code snippet:

this.ReportViewer.ReportServiceURL = @"https://demos.boldreports.com/services/api/ReportViewer";
this.ReportViewer.ReportServerUrl = "http://<servername>/reportserver$instanceName";
this.ReportViewer.ReportServerFormsCredential = new BoldReports.UI.Xaml.ReportServerFormsCredential("ssrs", "RDLReport1");
this.ReportViewer.ReportPath = "http://<servername>/reportserver$instanceName/SSRSSamples/Territory Sales.rdl";
this.ReportViewer.RefreshReport();

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 of the UWP Report Viewer.

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

    this.ReportViewer.ReportServiceURL = @"https://demos.boldreports.com/services/api/ReportViewer";
    this.ReportViewer.ReportServerUrl = "http://<servername>/reportserver$instanceName";
    this.ReportViewer.ReportPath = "http://<servername>/reportserver$instanceName/SSRSSamples/Territory Sales.rdl";
    this.ReportViewer.RefreshReport();
  2. To set shared datasource credentials in Web API Controller, use the following code in the OnReportLoaded method.

    [NonAction]
    public void OnReportLoaded(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 must be added for shared data sources that do not have credentials in the connection strings.

See also