Even though the report items (SubReports
) are not visible, they are still going to be processed by the reporting engine which is the intended behavior. In order to work around this you can remove the items from the report definition based on the user input. This requires programmatic report generation.
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
Another approach is to apply filtering on the data source level to the sub-report's data sources. When a data item
is hidden in the report (Visible=False
), it does not need to retrieve data in your particular scenario. Thus, if you apply filtering on the data source level
based on report parameters
and data source parameters
, you will be able to speed up the report noticeably without having to generate reports programmatically.
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.