Ricardo Vazquez Armenta > Data-Reporter-1.4 > Data::Reporter::VisSection

Download:
Data-Reporter-1.4.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

VisSection - handler to manipulate sections in VisRep.pl.

SYNOPSIS ^

        use Data::Reporter::VisSection;

        $section = new Data::Reporter::VisSection();
        $section->configure(Name => 'mydetail',
                        Lines => ('line 1', 'line 2', 'line 3'),
                        Code => "print 'this is the detail section\n';",
                        Size => 3,
                        Break_field => 0,
                        Width => 20,
                        Only_code => 0);
        my $name = $section->name();
        my $size = $section->size();
        my $break_field = $section->break_field();
        my @lines = $section->lines();
        my $code = $section->code();
        my $only_code = $section->only_code();
        $section->append("print 'this is the last line of code\n');
        $section->insert("print 'this is the first line of code\n'");

        open OUT, "out.txt";
        $section->generate(\*OUT);

DESCRIPTION ^

new();

Creates a new section handler

$section->configure(option => value)

valid options are:

Name Section name

Lines array of Lines to be printed in this section

Code Code to execute before printing the data section

Size Number of lines in the section

Break_field Field number in which the break applies

Width Numbers of columns in section

Only_code Indicator for a no-lines section

$section->name()

Returns the section's name

$section->size()

Returns the section's size

$section->break_field()

Returns the section's break_field

$section->lines()

Returns an array with the section`s lines

$section->code()

Returns the section's Code

$section->only_code()

Returns the only_code indicator

$section->generate(\*OUT)

Print perl code in OUT handler. This code is the section's information

NOTES ^

A section is a part of a report. For example the header section, the title section, etc. Each section has two parts:

Code part

This contains perl code, which is executed before printing the data lines of the section. This is useful because you can prepare the data to print in the report or acumulate totals. The special variable @field, is used to print data in lines.

Lines part

Here are the lines to print. The lines are printed using the RepFormat module, there are special fields in printing the lines:

@Fn

This field generates code to print $field[n]

@Pn

This field generates code to print $report->page(n). page is a special feature from Reporter module

@Tn

This field generates code to print $report->time(n). time is a special feature from Reporter module

@Dn

This field generates code to print $report->date(n). date is a special feature from Reporter module

syntax highlighting: