Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: How to construct @data for PDF::Report::Table->addTable

by poj (Prior)
on Aug 11, 2013 at 07:43 UTC ( #1048983=note: print w/replies, xml ) Need Help??

in reply to How to construct @data for PDF::Report::Table->addTable

If it's any help this produces a pdf but with warnings : Incorrect Table Geometry ! Setting bottom margin to end of sheet and doesn't set the 2nd page to Landscape.
#!perl; use strict; use PDF::Report; use PDF::Report::Table; # test data rows=20 my $ar = testdata(20); my $pdf = new PDF::Report('PageSize' => 'LETTER', 'PageOrientation' => 'Landscape',); $pdf->newpage(); my ($width, $height) = $pdf->getPageDimensions(); my $margin = 50; $pdf->setAddTextPos($margin,$height-$margin); my $tbl_wrt = PDF::Report::Table->new($pdf); $tbl_wrt->addTable([@$ar],$width-$margin*2,5,'#ffffff','#ffffcc'); $pdf->saveAs('testA.pdf'); sub testdata{ my $rows = shift; my @ar=(); push @ar ,[$_, "col2-$_", "col3-$_", "col4-$_", "col5-$_", "a very wide column 6-$_ that has a lot of text and more than 1 line"] for (1..$rows); return \@ar; }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1048983]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2017-06-26 10:32 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (577 votes). Check out past polls.