BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi,
I have the Report Viewer working with SSRS and now I want to get a list of data sources within a report (so I can know what connection strings to assign).
I have code like this :
public void OnReportLoaded(ReportViewerOptions reportOption)
{
// Fetch the data sources used in the report.
var dataSources = ReportHelper.GetDataSources(_jsonResult, this, _cache);
}
But it always returns null.
Is there another way of getting a list of data sources?
It has to be before the data is fetched so I have time to set DataSourceCredentials like this :
reportOption.ReportModel.DataSourceCredentials.Add(new BoldReports.Web.DataSourceCredentials()
{ Name = thisDataset, ConnectionString = connectionString,
UserId = userID, Password = password, IntegratedSecurity = integratedSecurity });
Thanks
Paul
Hi Paul,
Thanks for contacting Bold Reports support.
Paul, If you want to get the list of all data sources within a report, you need to use your report with the prompt credentials, as shown in the below snapshot. We have prepared and attached the sample application for your reference.
|
|
To get a list of data sources without prompting for credentials, we are internally checking with the team and will update your details for this before the end of this week.
Regards,
Arumugasami M
Hi,
Thanks for the update, but it will not be practical to prompt for credentials.
I will await your findings on how to get the list without prompting for credentials.
At the moment I am simply setting many datasource credentials for the report, using many data source names that I know are possible and that _might_ be in the report. This works, but it would be more elegant to know exactly the datasource names in the report so I can just target those.
Paul
Paul,
Thanks for the update.
To get a list of data sources without prompting for credentials, we are internally checking with the team and will update the details before the end of this week.
Paul,
We have logged this as a bug from
our end and the changes will be included in the bi-weekly nuget
release, which is scheduled for January 04, 2023.
You can track the status of this bug using below
feedback portal link.
Paul,
Could you please set the Boolean value to true in the GetDataSources method as shown in the below snap to get the data source for window credentials?
That works, thank you.
Paul,
We are glad to hear that the reported issue has been resolved on your end. If you face any other issues, we suggest you open a new ticket using your account.