BigJerry has asked for the wisdom of the Perl Monks concerning the following question:
Hi All:
I'm trying to switch from using old-style formats to those provided by Perl6::Form. Simple reports seem to work fine, but now I'm trying to convert several scripts that retrieve a list of column values from MySQL and then print a formatted list of the returned results. Thebse can be several pages in length, so I was trying to use the 'page' and 'header' options to print headings at the top of each page, breaking the list at a defined page size. From the documentation, I can't put this together so it works. The script basically prints inside a loop which fetches each selected row from the database. If I try
print form { page => { length => 10, number => 1, feed => "\f", footer => "\n", header => { first => "================================ +=====================================\n" . "| xxxxxxxxxxxx +xxxxxxxxxxxxxxxx |\n" . "| xxxxxxxxxx +xxxxxxxxxxxx |\n" . "| + |\n" . "| List +of Players |\n" . "|=============================== +====================================|\n" . "|Last |First + |MI|Suffix|Nickname | ID|\n" . "|_______________________________ +____________________________________|", other => "================================ +=====================================\n" . "| List +of Players |\n" . "|=============================== +====================================|\n" . "|Last |First + |MI|Suffix|Nickname | ID|\n" . "|------------------------------- +------------------------------------|", } } };
before the loop and then use another 'print form' inside the loop to print the values from each row, I get the first page headers followed by enough blank lines to fill a page, then the normal list of rows. Not what I wanted. If I try putting the page/header information in the single 'print form' inside the loop, I get get the first page header pluse the row information for each and every row. Also not what I want.
Obviously, I'm misunderstanding something, but what? I searched the web for eamples of using Perl6::Form, seeking understanding, but found none.
I would be eternally appreciative of any help you could offer. Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Headings in Perl6::Form
by TomDLux (Vicar) on Aug 26, 2011 at 03:21 UTC | |
|
Re: Headings in Perl6::Form
by Anonymous Monk on Aug 26, 2011 at 06:29 UTC | |
by BigJerry (Initiate) on Aug 28, 2011 at 03:35 UTC | |
by Anonymous Monk on Aug 28, 2011 at 08:07 UTC | |
by BigJerry (Initiate) on Aug 28, 2011 at 23:36 UTC |