Wednesday, 27 June, 2007 10:34
Module Name Proposal - Text::Report

I have created a module that will allow you to create neatly
formatted, text based reports that contain any number of tables of
various dimensions replete with configurable & optional titles, column
headings, decorations, sorting, column alignment and more.

Output can be a formatted report suitable for formal presentation
and/or you can produce comma delimited data either by individual
tables or the entire report.



I've tried to keep the interface simple and flexible. There are three
components to configure.

The 'report' component includes the width of the report itself, the
way that the 'blocks' of data are ordered within the report (either
automatically or by explicit indexing) and the way that table titles
are printed for each 'block' or data set.

The 'block' component is manipulated by its name and can contain
either free-form string data, a decorative separator, or columnar data
as a table or footer. Columns in each block created can be
automatically sized or the size (width) and alignment can be defined
by the user either globally or per column.

An example of a block definition:
$rpt->defblock(name => 'data',
      title => 'Resultant Amalgamum Firnunciation Per Anum',
      useColHeaders => 1,
      columnAlign => 'right',
      cols => 6,
      pad => {top => 2, bottom => 2},);



The 'column' component is manipulated by the block name that contains
it and the column position in the table. Columns can be addressed
individually to tweak the alignment, width and the column header.

For example:
$rpt->setcol($blockname, $colnum, align => 'left', width => 7)



Building the report is easy. Once all of the report blocks are
defined, you apply the 3-dimensional data to the named block of choice
in the form of:

$obj->fill_block($blockname, @AoA)

Where:
@AoA = (
['data', 'data', 'data', 'data'],
['data', 'data', 'data', 'data'],
...);


Coughing up a report or csv data is even easier using

@report = $obj->report(['get' | 'print' | 'csv'])

There are numerous other features that I won't waste time detailing
here. Some are documented in the pod and others I will create examples
for.


I've also incorporated a feature that allows you to save the defined
report as a template (using Storable store() & retrieve()) and reuse
it. (This feature may not be documented in the pod yet)


I think the module is ready for prime time and I would appreciate a
blessing on the name and the module's desirability. And certainly any
feedback if anyone would like to take it for a spin.


The POD is here:
http://www.full-duplex.com/~pan/Text-Report-1.002.html

The Source can be found here:
http://www.full-duplex.com/~perl/lib/Text/Report.pm


This is my first contribution and seasoned advice is welcomed.

Thank you,

-David

  

David J. Huggins
Chief Design Engineer
Full-Duplex Communications Corporation
www.full-duplex.com
www.in-brandon.com
--------------------------------

Reply via email to