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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding RDL data source programmatically

Thread ID:





127545 Nov 22,2016 11:48 AM UTC Nov 23,2016 11:23 AM UTC WPF 1
Tags: ReportWriter
Asked On November 22, 2016 11:48 AM UTC


I am using a RDL template and I would like to programmatically add my data source specifying SQL CE database file location (pathToApplication\database.sdf). 

I have seen these two lines in the documentation under Generating RDLC Reports:

ReportDataSourceCollection dataSources = new ReportDataSourceCollection();
dataSources.Add(new ReportDataSource { Name = "ProductCatalog", Value = ProductCatalogSource.GetData() });
but it does not do what I want since the collection or ReportDataSource itself does not contain the setPath() method or something similarly.

I would be glad if you could help me out.

In advance thank you for your help.

Karmen Gostiša

Vinoth Srinivasan [Syncfusion]
Replied On November 23, 2016 11:23 AM UTC

Hi Karmen, 
Thanks for contacting Syncfusion support. 
The RDL reports has connection details within the report datasource to get necessary data for rendering, so you can’t set the data values in code behind using the shared code snippet. You can programmatically edit/modify the RDL reports to change the “connection string” of existing datasource or you can add new datasource. Refer to the following Knowledge base to edit the report definition of a report in code behind. 
Vinoth S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon