This queue is for tickets about the Spreadsheet-WriteExcel CPAN distribution.
Maintainer(s)' notes
If you are reporting a bug in Spreadsheet::WriteExcel here are some pointers
1) State the issues as clearly and as concisely as possible. A simple program or Excel test file (see below) will often explain the issue better than a lot of text.
2) Provide information on your system, version of perl and module versions. The following program will generate everything that is required. Put this information in your bug report.
#!/usr/bin/perl -w
print "\n Perl version : $]";
print "\n OS name : $^O";
print "\n Module versions: (not all are required)\n";
my @modules = qw(
Spreadsheet::WriteExcel
Parse::RecDescent
File::Temp
OLE::Storage_Lite
IO::Stringy
Spreadsheet::ParseExcel
Scalar::Util
Unicode::Map
);
for my $module (@modules) {
my $version;
eval "require $module";
if (not $@) {
$version = $module->VERSION;
$version = '(unknown)' if not defined $version;
}
else {
$version = '(not installed)';
}
printf "%21s%-24s\t%s\n", "", $module, $version;
}
__END__
3) Upgrade to the latest version of Spreadsheet::WriteExcel (or at least test on a system with an upgraded version). The issue you are reporting may already have been fixed.
4) Create a small but complete example program that demonstrates your problem. The program should be as small as possible. At the same time it should be a complete program that generates an Excel file. If the Spreadsheet::WriteExcel section is part of a much larger program then simplify it down to the essentials. Simulate any DB reads with an array.
5) Say if you tested with Excel, OpenOffice, Gnumeric or something else. Say which version of that application you used.
6) If you are submitting a patch you should check with the author whether the issue has already been patched or if a fix is in the works. Patches should be accompanied by test cases.
Asking a question
If you would like to ask a more general question there is the Spreadsheet::WriteExcel Google Group.
Owner: |
jmcnamara [...] cpan.org
|
Requestors: |
shell_hung [...] ucr.com.hk
|
Cc: |
|
AdminCc: |
|
|
Severity: |
(no value)
|
Broken in: |
(no value)
|
Fixed in: |
(no value)
|
|
Fri Oct 10 04:47:58 2008
shell_hung [...] ucr.com.hk - Ticket created
Hi,
Is the library have a "quantity limit" when using add_format() ?
For example :
#!/usr/bin/env perl5.8.8
use Spreadsheet::WriteExcel;
my $workbook = Spreadsheet::WriteExcel->new("./test.xls");
my $worksheet = $workbook->add_worksheet("add_format");
my %XLSFmt = ();
%{ $XLSFmt{'fmt1'} } = (
font =>'Times New Roman',
size =>'12',
valign =>'vcenter',
align =>'center',
bold => '1'
);
for (my $row=1; $row<=5000; $row++)
{
$worksheet->write($row, 1, "Row : $row",
$workbook->add_format(%{ $XLSFmt{'fmt1'} }) );
$worksheet->write($row, 2, "Row : $row",
$workbook->add_format(%{ $XLSFmt{'fmt1'} }) );
$worksheet->write($row, 3, "Row : $row",
$workbook->add_format(%{ $XLSFmt{'fmt1'} }) );
$worksheet->write($row, 4, "Row : $row",
$workbook->add_format(%{ $XLSFmt{'fmt1'} }) );
$worksheet->write($row, 5, "Row : $row",
$workbook->add_format(%{ $XLSFmt{'fmt1'} }) );
$worksheet->write($row, 6, "Row : $row",
$workbook->add_format(%{ $XLSFmt{'fmt1'} }) );
$worksheet->write($row, 7, "Row : $row",
$workbook->add_format(%{ $XLSFmt{'fmt1'} }) );
$worksheet->write($row, 8, "Row : $row",
$workbook->add_format(%{ $XLSFmt{'fmt1'} }) );
}
All format disappeared after C4096, but when I replace the code to :
my $format = $workbook->add_format( %{ $XLSFmt{'fmt1'} } );
......
$worksheet->write($row, ......., $format);
This problem never happen again.
Perl 5.8.8 (compiled by gcc 3.2, 20020903)
Spreadsheet-WriteExcel-2.21
Linux kernel 2.4.36.6
Shell
Fri Oct 10 05:19:04 2008
jmcnamara [...] cpan.org - Taken
Fri Oct 10 05:34:39 2008
jmcnamara [...] cpan.org - Correspondence added
Hi,
Excel has a limit on the number of unique formats that it supports in a
file. Currently Spreadsheet::WriteExcel creates a new format for every
call to add_format() even if the format is the same as a previous
format. As such you are probably running into Excel's format limit.
The solution is (as you spotted) to avoid creating mulitple versions of
the same format in a loop.
This limitation will be removed in a later release, but for now try to
reuse similar formats where possible and avoid creating the same format
repeatedly in a loop.
John.
--
Fri Oct 10 05:34:42 2008
The RT System itself - Status changed from 'new' to 'open'
Wed Nov 21 18:50:54 2012
jmcnamara [...] cpan.org - Correspondence added
Closing this issue. Can't fix.
Suggest using Excel::Writer::XLSX instead.
Wed Nov 21 18:50:55 2012
jmcnamara [...] cpan.org - Status changed from 'open' to 'resolved'