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

Disabling/turning off sections/subreports

5 Answers 138 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris Trina
Top achievements
Rank 1
Chris Trina asked on 02 Apr 2014, 03:33 PM
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

5 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 07 Apr 2014, 11:35 AM
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.

 
0
Chris Trina
Top achievements
Rank 1
answered on 07 Apr 2014, 12:25 PM
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
0
Nasko
Telerik team
answered on 10 Apr 2014, 09:50 AM
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.

 
0
Tracy
Top achievements
Rank 1
answered on 05 Jun 2015, 02:16 PM

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.

0
Nasko
Telerik team
answered on 08 Jun 2015, 11:35 AM
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
Tags
General Discussions
Asked by
Chris Trina
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Chris Trina
Top achievements
Rank 1
Tracy
Top achievements
Rank 1
Share this question
or