Disabling/turning off sections/subreports

6 posts, 0 answers
  1. Chris Trina
    Chris Trina avatar
    87 posts
    Member since:
    Mar 2006

    Posted 02 Apr 2014 Link to this post

    What is the best way to not run a section or a subreport?  We have reports where the user can request different levels of detail, we are currently using a binding to make the section/subreport not visible.  While this works visually, it appears, based on timings and breakpoints that the nonvisible components are still being built.  Ideally we would like to completely turn these sections off to avoid the extra overhead.

    Thanks

    Chris
  2. Nasko
    Admin
    Nasko avatar
    1045 posts

    Posted 07 Apr 2014 Link to this post

    Hello Chris,

    Another approach is to gather the user input and based on that create/change the report programmatically. Note that creating a tool or a module which will generate the entire report definition on the fly based on some user defined rules and settings is not a trivial matter. In general, the fastest way to do this is to to create the desired report layout in the Visual Studio Report Designer and use the code it automatically generated in the .Designer.cs file as a template for dynamic report generation. In this undertaking you may also find useful the Programmatic Control of Reports help articles on the topic and the Reporting API Reference.

    Binding the Visible property of a report item/section is easier and more straight forward approach, however you may go with the programmatic report generation if you don't mind the extra coding needed.

    Regards,
    Nasko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Chris Trina
    Chris Trina avatar
    87 posts
    Member since:
    Mar 2006

    Posted 07 Apr 2014 in reply to Nasko Link to this post

    Nasko,

    It isn't a case were we redesign the report based on their input, there are about 50 parameters that they can adjust each time they run it and based on those parameters that tells us what features to turn off.  Today we are doing this by binding the visible property of the fields /  sections /  lists / subreports and that does work.  However, even though the feature is not visible it seems to still being executed, including database calls, resulting in lots of extra overhead.  Ideally if a section, list, or subreport is not visible we would like it not executed.  Or, is there a different property we could be setting?

    Chris
  4. Nasko
    Admin
    Nasko avatar
    1045 posts

    Posted 10 Apr 2014 Link to this post

    Hello Chris,

    Even though the items are not visible, they are still going to be processed by the reporting engine. In order to work around this your only option is to remove the items from the report definition based on the user input. This requires programmatic report generation, as elaborated in my previous reply.

    Regards,
    Nasko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Tracy
    Tracy avatar
    13 posts
    Member since:
    Nov 2010

    Posted 05 Jun 2015 Link to this post

    Not to belabor the point but there is no way to simply say, don't execute a sub-report? I have a report that may only have 20 records to show but the users want to include images. The images are added via sub-report. It takes over an hour to run the report as the 20 records reference 198 images. I'd like to give the user the option to not include images, and simply ignore or not process the sub report. I set the visible property but it still processes all 198 images, based on the time it takes to run. There is no expression I can add to a binding to basically skip the sub-report completely?

     I'm using telerik report designer and really don't have the option to do this programatically, I'm not a programmer.

  6. Nasko
    Admin
    Nasko avatar
    1045 posts

    Posted 08 Jun 2015 Link to this post

    Hello Tracy,

    In addition to setting the SubReport item's visibility, you can conditionally set its ReportSource property expression based on a data field or a report parameter value.
    Setting the ReportSource property to a Null will prevent the sub-report from being processed. Please check this screenshot for more information on the approach.

    Regards,
    Nasko
    Telerik
    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