We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
If you became a customer of the Syncfusion Reporting Platform or the Report Viewer, Report Designer, or Report Writer components before October 2019 and have questions related to those products, you can request support through our forum system. However, please note that this support system is only for existing customers who are still using the Syncfusion Reporting Platform or its components and not for new customers looking for reporting products from Syncfusion.

For new customers or those with general reporting questions, we recommend contacting our support team at https://support.boldreports.com/, which is a separate brand created by Syncfusion for its reporting solutions. Our team will be happy to assist you with any questions you may have.

Thank you for choosing Syncfusion for your reporting needs.

How to see the data sources within a report?

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


7 Replies 1 reply marked as answer

AM Arumugasami Murugesan Syncfusion Team December 13, 2022 12:07 PM UTC

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


Attachment: BlazorReportViewer_790cbd18.zip


PA Paul December 14, 2022 02:00 AM UTC

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



AM Arumugasami Murugesan Syncfusion Team December 14, 2022 06:29 AM UTC

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.



AM Arumugasami Murugesan Syncfusion Team December 16, 2022 09:43 AM UTC

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. 

https://www.boldreports.com/feedback/39826/the-datasource-value-comes-as-null-when-using-the-windows-credential-in-the



AM Arumugasami Murugesan Syncfusion Team December 21, 2022 10:31 AM UTC

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?



Marked as answer

PA Paul December 22, 2022 04:33 AM UTC

That works, thank you.



AM Arumugasami Murugesan Syncfusion Team December 22, 2022 06:28 AM UTC

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. 

https://support.boldreports.com/create


Loader.
Live Chat Icon For mobile
Up arrow icon