New to Telerik Reporting? Download free 30-day trial

Modifying or creating a report at Runtime

Environment

Product Progress® Telerik® Reporting

Description

Our recommendation is to avoid making changes to the report definition. Note that it is always better to design reports with the available Report Designers and let the designer serialize the settings in a manner that will cause minimum issues on upgrade.

Solution

In case the available designers and wizards do not help you to accomplish your task, the recommended approach to modify/create reports is before starting to process them (before displaying them).

  • To modify a report, you can create an instance of the report designed in the Visual Studio Report Designer, or you can deserialize/unpackage a TRDX/TRDP file to get a Telerik.Reporting.Report instance for work. Once you have the report instance, you have access to all items in it through the report's Items collection. You can use the Find method to get a specific item/section that has to be modified.

An example of such modification is illustrated in Changing the connection string dynamically according to runtime data.

All modifications must be done before wrapping the report in a Report Source object on the server machine. If you are using a Reporting RESTor WCF service, modifications can be done in a custom resolver plugged in the service.

  • To create a report, our recommendation is to start by using the Visual Studio Report Designer. You can create a sample report with the desired layout and test data. The VS Report Designer will serialize automatically the settings in the report's Designer.cs|vb file. this code can be re-used and modified at run-time.

All modifications must be done before wrapping the report in a Report Source object on the server machine. If you are using a Reporting RESTor WCF service, modifications can be done in a custom resolver plugged in the service.

Notes

Events are not recommended for modifying/creating items and data source components as they fire once the report's processing is started, at that time, the report template is evaluated against the assigned data.

See Also

In this article