WPF Multipage Reports Part I

When you are building LOB apps, reporting is one of the most important parts.  MS Reporting Services or some other 3rd party reporting solution is usually a choice. What I personally don’t like on MS Reporting services is the definition of styling and related maintenance issues. The fact that it ignores WPF and its capabilities forced me to think about custom implementation of our reporting components.

WPF brings two types of documents, the fixed page document and the flow document. Both are used for different types of reports.

  • Fixed documents are appropriate for predefined forms with absolute positioning. In this case the implementation is pretty straightforward but it is not in the scope of my posts.
  • Flow documents are more suitable for multipage reports (e.g. monthly accounting report).
    I will try to describe the implementation of a simplified multipage reporting engine in a series of posts on this blog.

For the illustration suppose you have a report definition as a flow document like this.

The main components are:

Report definition

Defines the basic structure of a report and contains templates for each report part.

Data engine

Gets data from a data source and provides selected calculation tasks, e.g. cumulative sum and grouping.

Report Data

Contains all tha data , that are produced from the data engine and passed further to the report engine

Report engine

The most important part. This part is responsible for the composition of a flow document.

Report paginator

Modifies default flow document paging behavior. Enables custom page header , footer and other page transformations.

Document walker

Traverses any part in the document definition.

Print Helper

Encapsulates print queue and print ticket classes.

In future posts I will go deeper and I will show the inner implementation of selected components.

Posted 1/19/2011 3:02:31 PM by admin
Filed under: CodePlant, .NET