Product · .NET · open source

A Report Printing Framework

A .NET library for building print reports graphically, with a visual designer. Distributed under the BSD licence.

Description

ReportPrintingFramework is a library for .NET 2.0 or later, for building print reports graphically and quickly. It extends the base printing library written by Mike Mayer in 2003.

To work correctly it needs a modified version of the ReportPrinting printing library, which I distribute together with the framework.

I have used ReportPrinting on several jobs and came to appreciate its flexibility and lightness, in the sense of dependencies and additional libraries — particularly when compared with CrystalReports, which certainly has a great many more features, but useless ones in many cases.

The main limitation was that reports had to be built programmatically, calling methods and properties of the library. So the idea came of a framework able to load a report from an XML file — easy to edit — and build the report from that. The next step was a minimal visual designer for creating the report files.

You can read the detailed article published on CodeProject.

Main features

  • Positioning and resizing of static objects — text labels, lines, boxes, images — and dynamic ones — variables, tables — on the drawing surface, by dragging and drag & drop
  • Multiple selection of objects and editing of their properties: font, colours, borders, position, size
  • Print preview

Installation

No particular procedure is required: simply add a reference to ReportPrintingFramework.dll and ReportPrinting.dll in your application.

Usage

To print a report:

  1. Create a ReportPrintingFramework.RPFReportMaker object
  2. Assign the dynamic objects, tables and variables, for the report to print
  3. Create a ReportPrinting.ReportDocument object
  4. Load the report from file with report_maker.Load(filename)
  5. Assign report_maker to the ReportMaker property
  6. Print the document

To use the designer:

  1. Create a ReportPrintingFramework.RPFDesignerControl object
  2. Assign the dynamic objects for the report to print
  3. Load the report from file, if one already exists, with LoadDocument(filename)
  4. Save the changes with SaveDocument()

For further details, refer to the source code of ReportPrintingFrameworkDemo.

Credits

The base printing library ReportPrinting is by Mike Mayer. This framework extends it and distributes a modified version of it, as its licence allows.