News

Documatic has now merged with the Ruby Reports project!

Ruby Reports (Ruport) is the premiere reporting platform for Ruby.  We've worked out a way to integrate Documatic and Ruport in a way that enhances the functionality of both.

Documatic 0.0.2 is now available, and when installed acts as a Ruport extension.  It provides a formatter for Ruport that allows the use of templates driven by Documatic.  You can render your Ruport tables, groups and groupings using an OpenDocument template.

This arrangement offers you the best of both systems: Ruport's rich and elegant data modelling classes, and Documatic's flexible rendering.

More information on Documatic is available on the project wiki, here:

http://stonecode.svnrepository.com/documatic/trac.cgi/wiki

If you have any questions please contact the Ruby Reports mailing list, here:

http://groups.google.com/group/ruby-reports

Welcome to Documatic

Documatic is an OpenDocument processor for Ruby.  It can be used to produce attractive printable documents such as database reports, invoices, letters, faxes and more.

Documatic brings all the power of embedded Ruby to your OpenDocument files.  You can create richly formatted templates with software such as OpenOffice.org and merge them with data drawn from one or more sources, including databases and others.

 How it Works

You prepare templates in OpenOffice.org with embedded Ruby code.  The embedded code can be used to render values, or can contain control structures - conditional statements, loops etc.  Documatic understands how to loop over paragraphs, list items and table rows.

You compile your templates.  This converts the marked up contents of the template into embedded Ruby, and stores the embedded Ruby within the OpenDocument file itself.  You need to compile your templates any time you make changes to them.

Your compiled templates can then be merged from within a Ruby program.  The instance variables in your code are used by the embedded Ruby processor to generate a valid OpenDocument file, which is then saved.

Context

Documatic can be used from within standalone Ruby programs.  For example you could write a report generator that periodically queries a database, merges the data into a Documatic template, and emails the resulting document to selected recipients.

Documatic can also be used from within Ruby on Rails. 

Documatic can use data queried from your database using ActiveRecord, Ruby DBI, or data from other sources (system commands, data obtained from other sites via web services, etc.).  You could write a front-end to your document processor using Ruby on Rails, and also include data entered by your users in the generated documents.

Documatic doesn't require OpenOffice.org when compiling or merging templates, so it can be used to generate documents from hosts/servers without OpenOffice.org installed (e.g. shared hosting servers).  You only need OpenOffice.org to edit your templates.

Try it

This site features a simple Documatic report online for you to try.

Page List Report

The sources for that report are available for download.  You can also download a demonstration of a standalone Ruby program that generates a Documatic report from the Usage page.

Availability

Documatic is Free software (public domain), available through Rubyforge.  It is distributed as a cross-platform Gem you can "require" into your Ruby program.