Examples

This page contains examples of some interesting formatting tasks you might want to perform with Ruport and Documatic.

Please check back later: this page is expanding all the time!

Mailing Labels

If you plan to do mailing labels with Ruport and Documatic, you really want to visit this excellent site:

http://www.worldlabel.com/Pages/openoffice-template.htm

It provides a whole range of US and European mailing label templates for OpenOffice.org. The attached file mailing_labels.zip illustrates how I took one of those templates and adapted it for printing mailing labels using Ruport.

Grouped Report

Users who are familiar with Crystal Reports might recognise what inspired this example. The attached file sales_report.zip demonstrates how to write a report with nested levels of grouping, including totals and subtotals.

Multiple Data Sources

Documatic works well with Ruport tables, groups and groupings, but you're not restricted to only these. You can write reports using multiple data sources that may be of any format -- Ruby data structures (hashes, arrays, etc.), XML data, or anything else Ruby can handle.

The attached file multi.zip illustrates how to invoke Documatic rendering directly with multiple data sources. It also illustrates how you can use subreports to represent different parts of the data.

Note that this example depends on XmlSimple (gem install xml-simple).

Attachments