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

Fellow Sku... err, Monks :)

I have been processing data for use by Windows users, and I've come across a problem while using Spreadsheet::SimpleExcel. The problem is that print formatting, such as landscape mode and duplexing, does not propagate beyond the first page. I've seen things go wrong in similar ways when creating files in OpenOffice as well, so I'm wondering if this is yet another example of M$ being a moving target.

Source file created by Perl 5.8.5 and SimpleExcel 0.5 on FreeBSD 4-STABLE, output read on Excel XP/2003.

What can I do about it? Does WriteExcel also have the same difficulty? Is there something that I am doing incorrectly in using it? Thanks very much in advance!!! :D
use Spreadsheet::SimpleExcel; … my $excel = Spreadsheet::SimpleExcel->new(); ... for $ptest (@testit) { gendevexcel($ptest, $howfar, $ourt, $excel); } … $excel->output_to_file("./ursh400-050420-G.xls") or die $excel->errstr +(); … sub gendevexcel { my ($pint, $far, $ours, $excel) = @_; ... my @headr = ("Part Num", "Temp."); foreach my $d (@gooddevarray) { push(@headr, $d); } my @data = ([('')]); push (@data, ["$pint - " . $pinnames{$pinnum}]); push (@data, [('')]); … push (@data, [@]); … $excel->add_worksheet("$pint",{ -headers => \@headr, -data => \@data }); … }

Replies are listed 'Best First'.
Re: Excel changes?
by dragonchild (Archbishop) on Apr 21, 2005 at 15:13 UTC
      Okay, my bad. I thought that Excel would globalize things.

      Thanks, dragonchild! :D
        Excel DWIMs, but the XLS file format does not. True to the format, Spreadsheet::WriteExcel will let you recreate the same cell format over and over, which may become a problem as there is a finite limit on the number of formats a given XLS file will allow.

        Various modules that wrap around Spreadsheet::WriteExcel may or may not do the right thing. For example, it took 6 months and three programmers to do it right in Excel::Template.