Have you ever spent a large amount of time designing a Telerik Report only to discover that its output is not entirely what you expected? This is the type of problem that can occur if you don't have a full understanding of the Report Life Cycle. The Report Life Cycle defines what happens and when it happens in Telerik Reporting. Understanding the Life Cycle is crucial to effectively using Telerik Reporting, which is why I plan on spending some time explaining it in detail today.
 
The diagram in Figure 1 provides a high level overview of the sequence of events from creating a report in the designer to having the final completed document. I am going to break down each of these steps and explain them in more detail below.
Report Life Cycle
Figure 1

Report Designer to Report Class

The Report Life Cycle begins when you start designing a report in the Visual Studio Report designer. It is during this phase that it is most important to remember what happens later on in the Life Cycle. Once you've completed the design of a report through the use of the Report designer, you will be left with a single class that embodies the report definition. This "Report Class" will be used as input during the Report Processing phase.

Report Processor to Report Instance

When you click preview in the Report Designer or when you display a report in your application, before the report is rendered, it must be processed. During this phase, the data source is bound, calculations are performed, and ItemBinding/Bound Events are fired. Once this phase completes, the data retrieved from the data source is cached along side the newly output, Report Instance.

Each section of a report is treated differently during the processing phase, so you must be careful about what types of data you try to display where. The following outline shows the types of data that are calculated during this phase for each section in the report.
  • Report Header
    • Aggregates for the entire report.
  • Page Header
    • Not processed during this phase.
  • Group Header
    • Aggregates based on data contained in the group.
  • Detail
    • Data source items
  • Group Footer
    •  Aggregates based on data contained in the group. 
  • Page Footer
    • Not processed during this phase. 
  • Report Footer
    • Aggregates for the entire report. 
Once processing is complete, a Report Instance has been produced. Report instances are used during the rendering phase of the Life Cycle.

Report Renderer to Output Document

During this phase, the report instance is passed to a specific rendering extension (HTML, PDF, etc.). If the rendering extension supports paging, Page Headers and Page Footers are output to each page, otherwise, they are omitted. In the case of subreports, Page Headers and Page Footers are always ommitted, because they do not apply. Here is an outline of the types of data that are calculated and may be displayed based on what happens during this phase:

  • Report Header
    • Rendered based on cached data from processing phase. 
  • Page Header
    • PageNumber, PageCount 
  • Group Header
    • Rendered based on cached data from processing phase.
  • Detail
    • Rendered based on cached data from processing phase.
  • Group Footer
    • Rendered based on cached data from processing phase.
  • Page Footer
    • PageNumber, PageCount
  • Report Footer
    • Rendered based on cached data from processing phase.
Once the rendering phase has completed, you will have a document of the specified rendering extension type available for use.

Related Posts

Comments

Comments are disabled in preview mode.