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.
Unfortunately, activation email could not send to your email. Please try again.

Adding RDL data source programmatically

Thread ID:

Created:

Updated:

Platform:

Replies:

127545 Nov 22,2016 06:48 AM Nov 23,2016 06:23 AM WPF 1
loading
Tags: ReportWriter
Karmen
Asked On November 22, 2016 06:48 AM

Hi!

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.

Regards, 
Karmen Gostiša

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

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. 
 
 
Regards, 
Vinoth S. 


CONFIRMATION

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.

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.

;