kean has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks! I use this simple Script to generate reports:
use strict; use warnings; use PostScript::Convert; use PostScript::Report (); # Describe the report: my $desc = { report_header => [ HBox => { border => 0 }, [ VBox => { width => 100 }, { value => \'Foo Bar Recycling' }, { value => \'123 Any Street' }, { value => \'Your Town, USA' }, ], ], # end report_header stripe => [ 0.85, '#FF0' ], # Grey & yellow columns => { data => [ # Header is centered Column is right ju +stified [ 'Number' => 40, { align => 'center'}, { align => 'right +'} ], [ 'Letter' => 40 ], [ 'Text' => 320 ], # Both header and column are right justif +ied [ 'Right' => 60, { align => 'right'}, { align => 'right' +} ], ], }, # end columns }; # Generate sample data for the report: my $letter = 'A'; my @rows = map { my $r=[ $_, $letter, "$_ $letter", "Right $_" ]; ++$letter; $r } 1 .. 76; # Build the report and run it: my $rpt = PostScript::Report->build($desc); psconvert($rpt->run(\@rows), 'pdf_image.pdf');
In the output pdf is one header with columns. Now i need to generate a report with two or more header+column combinations in one report. Is there a way to get this with PostScript-Report??

Replies are listed 'Best First'.
Re: PostScript-Report - Sections
by toolic (Bishop) on Aug 12, 2013 at 13:40 UTC
Re: PostScript-Report - Sections
by Monk::Thomas (Friar) on Aug 13, 2013 at 16:28 UTC

    Is PostScript-Report absolutely necessary? If not, then there may be a different way: Use TeX as intermediate format. This comes especially handy if the report is also required as HTML or any other format that TeX can produce.

    Richard Hardwick has written a nice article about that: http://tug.org/pracjourn/2010-1/hardwick/

    However I must confess it introduces a new set of problem: Properly escaping the meta characters. This is what I came up with. A more elegant solution may exist.

    # requires 'use utf8' and a utf8-enabled editor sub latexise_umlauts { my $string = shift; $string =~ s/\\/{\\backslash}/g; $string =~ s/\$/{\\\$}/g; $string =~ s/&/{\\&}/g; $string =~ s/%/{\\%}/g; $string =~ s/#/{\\#}/g; $string =~ s/_/{\\_}/g; $string =~ s/>/{\\textgreater}/g; $string =~ s/</{\\textless}/g; $string =~ s/ä/\\"a/g; $string =~ s/ö/\\"o/g; $string =~ s/ü/\\"u/g; $string =~ s/Ä/\\"A/g; $string =~ s/Ö/\\"O/g; $string =~ s/Ü/\\"U/g; $string =~ s/ß/\\ss{}/g; $string =~ s/²/\\textsuperscript{2}/g; $string =~ s/³/\\textsuperscript{3}/g; return $string; }
Re: PostScript-Report - Sections
by kean (Sexton) on Aug 12, 2013 at 10:56 UTC
    Or is it possible to format rows separatly? So i could format a row like a header...