in reply to Re: Headings in Perl6::Form
in thread Headings in Perl6::Form

Thanke, this helps greatly! Now I run into another problem which I can't find answered in the documentation.. For many of the records I have, people haven't provided their Middle Initials, and many simply don't have a Suffix. These fields are set to the proper number of blank characters in the record. When I run the report, these column values all get brought up to the top 'n' lines. For example, if only one of two people, the second one in the list has a middle initial, that middle initial will print for the first person, who doesn't have one, and the second person, who should have a middle initial, shows without one. I've tried using "layout=tablular" with no difference.

Any suggestions for further tries?

Replies are listed 'Best First'.
Re^3: Headings in Perl6::Form
by Anonymous Monk on Aug 28, 2011 at 08:07 UTC
    It's probably a bug (and certainly not desirable). I've reported it. The only workaround I can find at the moment is to use "\xa0" (a single non-breaking space) where no data is available. Like so:
    #! /usr/bin/perl -w use strict; use 5.010; use Perl6::Form; my @last = qw(Smith Jones Wright Wong Evans McFee Ho Nuygen Willians H +owlett Jones Peters Milford Tam Lam Soma Egon Wilson); my @first = qw(Jim Jack Wendy Lee Bo Lenord Jan Dana Lindy Kyle Nora J +ane Bill Woo John Mick Lazlo Jenna); my @mid = ("\xa0", "\xa0", 'A', "\xa0", "B", "\xa0", "\xa0", 'A', "\ +xa0", "B", "\xa0", "\xa0", 'A', "\xa0", "B", "\xa0", "\xa0", 'A'); my @suf = ("") x 18; my @nick = qw(Jim Jack Wendy Lee Bo Lenord Jan Dana Lindy Kyle Nora Ja +ne Bill Woo John Mick Lazlo Jenna); my @ID = 1..18; print form { page => { length => 15, 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" . "|------------------------------- +------------------------------------|", } } }, "| {]]]]]]]]]]]]]]]]} | {]]]]]]]]]]]]]]]]} |{}| {II} | {]]]]]]} | +{} |\n", \@last, \@first, \@mid,\@suf, \@nick, \ +@ID;

      Thanks again! This works, but each field replaced with the non-breaking space prints as a "?' which is not visually appealing. I did, however, find a slightly different solution which works for me.

      Following the documentation, I was trying to append a "\r" to each field to get a blank line after each row. Using a single "\r" didn't give me the blank line, but I noticed that it did get rid of the '?' in the blank columns. I discovered that if I appended "\r\r" I both got rid of the '?' in the blank columns and I got my blank line after each row. I'm a happy camper!