Articles in this section
Category / Section

How to pass data source or server credentials to the server side?

Published:
Updated:

This section explains how to pass data source or server credentials to the server side.

You can specify ReportServerCredential in the Web API Controller OnInitReportOptions method, as shown in the below snippet to connect to your 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 data-source.

reportOption.ReportModel.DataSourceCredentials.Add(new BoldReports.Web.DataSourceCredentials("AdventureWorks", "ssrs1", "RDLReport1"));
Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied