This is a migrated thread and some comments may be shown as answers.

Removing Parameter Data sources

3 Answers 563 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dolf
Top achievements
Rank 1
Dolf asked on 30 Sep 2016, 08:18 AM

Hi

 

I've got a problem with clearing data sources with the reporting framework. I dynamically create parameters with multi value data sources (csv datasources) for the report and that works fine.

When I import the report with reportPackager.Unpackage(targetStream); I am unable to remove the CSV data source with code. Even if I delete the parameter that is linked to the csv datasource it does not get removed from the designer and is still displayed in the designer.

Is there a way to remove Data sources that are linked to parameters.

 

Thanks.

3 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 04 Oct 2016, 03:55 PM
Hi Dolf,

The attached video illustrates our test based on the provided information. the data source components can be removed successfully after importing the report in VS Report Designer. The video is a SWF file that can be previewed in IE browser.

Please create a video illustrating the used by you Telerik Reporting version and the problem.
Thank you for your cooperation.


On a side note, in case you are removing data source components in code from teh report instance, the approach is to iterate all data items and to modify their DataSource properties e.g. the code from Changing the connection string dynamically according to runtime data.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Dolf
Top achievements
Rank 1
answered on 05 Oct 2016, 10:13 AM

Hi Stef

Thanks for the reply.

You are almost there with the answer except that I want to remove the parameter data source  with code and not via Visual Studio UI. 

I create parameters and their CSV data sources dynamically and save the report. Sometimes I remove a parameter via code, and it does remove the parameter from the report, but when I decide to add that same parameter to the report it complains that its CSV data source already exists.  Before I removed a parameter I set its CSV data source to null in the hope it would delete that CSV data source, but it doesn't. In summary I want to remove a CSV data source via code so when I open up the trdp In the report designer it doesn't exists as a data source anymore. Currently It keeps on persisting those CSV data sources and I have no idea how to get rid of them with code.

 

Thanks again for your time.

0
Stef
Telerik team
answered on 05 Oct 2016, 04:47 PM
Hello Dolf,

Please check the attached demo project that illustrates a report that is created in VS, its report parameters are removed and respectively unreferenced data source components are not serialized in the final TRDP file. The project uses Telerik Reporting R3 2016 that can be changed by using the Upgrade Wizard.

The idea is that you need to remove all references to the data source component to avoid serializing it at the end.


If you need further help, please modify the project to illustrate the problem and send it back to us in a support ticket, or let us know the changes via code snippets here.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Dolf
Top achievements
Rank 1
Answers by
Stef
Telerik team
Dolf
Top achievements
Rank 1
Share this question
or