Removing Parameter Data sources

4 posts, 0 answers
  1. Dolf
    Dolf avatar
    2 posts
    Member since:
    May 2012

    Posted 30 Sep Link to this post

    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.

  2. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 04 Oct Link to this post

    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
  3. DevCraft banner
  4. Dolf
    Dolf avatar
    2 posts
    Member since:
    May 2012

    Posted 05 Oct in reply to Stef Link to this post

    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.

  5. Stef
    Admin
    Stef avatar
    3053 posts

    Posted 05 Oct Link to this post

    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
Back to Top