Squirrel Logo

Data::Report - A flexible framework for reporting

Johan Vromans
Software & Tools


Description

Data::Report provides an easy API to define the layout of a report in terms of rows and columns.

The application then just feeds the data row by row.

Plugins take care of the details of report generation, using stylesheet-like controls for details like breaks.

Standard plugins are provided for text reports, HTML and CSV.

Example

use Data::Report;

my $rep = Data::Report::->create
  (type => "text",
   layout => [ { name => "acct", title => "Acct",   width => 6,  align => ">"  },
	       { name => "desc", title => "Report", width => 20, },
	       { name => "deb",  title => "Debet",  width => 10, align => ">" },
	       { name => "crd",  title => "Credit", width => 10, align => ">" },
	     ],
  );

$rep->start;
$rep->add({ acct => "8995", desc => "Received", deb => "100.00" });
$rep->add({ acct => "4980", desc => "Paid", crd => "100.00" });
$rep->add({ deb => "100.00", crd => "100.00", desc => "TOTAL" });
$rep->finish;

This produces a basic textual report like this:

  Acct  Report                     Debet      Credit
----------------------------------------------------
  8995  Received                  100.00
  4980  Paid                                  100.00
        TOTAL                     100.00      100.00

By changing type => "text" to type => "html" the same report will be generated as an HTML table. type => "csv" will produce comma-separated values, suitable to be imported in a spreadsheet.

View the slides from the Data::Report presentation.

Current version
0.03
Archived
CPAN sites. The MetaCPAN search engine will find it for you.


© Copyright 2003-2018 Johan Vromans. All Rights Reserved.
software/sw_datarep.html last modified 18:29:29 02-Oct-2006