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

How to add DataSources programmatically while preventing the user adding own DataSources

Thread ID:

Created:

Updated:

Platform:

Replies:

115630 Jan 27,2014 10:25 PM UTC May 19,2014 03:26 PM UTC WPF 6
loading
Tags: ReportDesigner
Patrick Crucq
Asked On January 27, 2014 10:25 PM UTC

Would be great to know if you can provide a sample with a local business object data source.

Anandakumar S [Syncfusion]
Replied On January 28, 2014 12:44 PM UTC

Hi Patrick,

Thanks for using Syncfusion Products.

We have prepared a sample for using local business object data source in ReportDesigner and it can be download from the following location.

Report sample: http://www.syncfusion.com/downloads/support/directtrac/118474/PreviewRDCL-6178121861707774314.zip

Please let us know if you have any questions.

Regards,

Anandakumar S


Patrick Crucq
Replied On January 30, 2014 06:27 AM UTC

Yeah, but is there a possibility to add the DataSet programmatically directly when the users starts the Report Designer to prevent the user to deal with more technical details?

Anandakumar S [Syncfusion]
Replied On January 31, 2014 10:03 AM UTC

Hi Patrick,


Thanks for your update.


ReportDesigner have AddDataSet , AddDataSource API’s for adding DataSource/DataSet to the Report from an existing ReportDefinition. You can use these API’s in ReportOpened / NewReportOpened event of ReportDesigner. Please find code snippet for this below.


AddDataSet/AddDataSource:


void ReportDesignerControl_NewReportOpened(object sender, ReportChangedEventArgs e)

{

this.ReportDesignerControl.AddDataSet("Path to the existing report", "DataSetName");

this.ReportDesignerControl.AddDataSource("Path to the existing report", "DataSourceName");

}


Please let us know if you have any questions.


Regards,

Anandakumar S


Anandakumar S [Syncfusion]
Replied On January 31, 2014 10:03 AM UTC

Hi Patrick,


Thanks for your update.


ReportDesigner have AddDataSet , AddDataSource API’s for adding DataSource/DataSet to the Report from an existing ReportDefinition. You can use these API’s in ReportOpened / NewReportOpened event of ReportDesigner. Please find code snippet for this below.


AddDataSet/AddDataSource:


void ReportDesignerControl_NewReportOpened(object sender, ReportChangedEventArgs e)

{

this.ReportDesignerControl.AddDataSet("Path to the existing report", "DataSetName");

this.ReportDesignerControl.AddDataSource("Path to the existing report", "DataSourceName");

}


Please let us know if you have any questions.


Regards,

Anandakumar S


System Administrator
Replied On April 9, 2014 04:14 PM UTC

Is there any way to add the data set/store without sourcing it from another report file? Our data may change dynamically so need a way to set the stores in code. I assume the only way at the moment would be to mock a fake report with data set in XML and write it to a stream to pass to AddReport?

Anandakumar S [Syncfusion]
Replied On May 19, 2014 03:26 PM UTC

Hi LEO LI,

 

We can also add DataSource /DataSet at runtime by modifying the ReportDefinition and we can load  it to the ReportDesigner. We have prepared a sample to modify the ReportDefintion dynamically, it can be downloaded from the following location.

 

Sample: http://www.syncfusion.com/downloads/support/directtrac/116065/ReportCustomization1938392844.zip

 

Please let us know if you have any questions.

 

Regards,

Anandakumar 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.

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

;