Skip Menu |

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.

Report information
The Basics
Id: 22934
Status: resolved
Priority: 0/
Queue: Spreadsheet-WriteExcel

People
Owner: Nobody in particular
Requestors: baldwin [...] panix.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: WriteExcel: generates bad Excel files
Date: Fri, 10 Nov 2006 12:40:06 -0500
To: bug-Spreadsheet-WriteExcel [...] rt.cpan.org
From: "J.D. Baldwin" <baldwin [...] panix.com>
I am getting repeated, and repeatable, corrupt file generation with WriteExcel on a certain data set. I am unable to isolate exactly why this particular data set creates corrupt files when other, similar, data does not. The data is imported using XML::Simple::XMLin, but the strings to be written are simple lists of IPs separated by newlines. I tested using Excel 2003 SP 2, which simply reports that the file was corrupt and a repair was attempted. Sometimes the first column of data is shown, and sometimes nothing at all is shown. Loading the same spreadsheet into StarOffice 7 (Product Update 4) shows "*** ERROR IN SST ***," in many cells, along with other data corruption. Based on other results, the corruption does not depend solely on the length of the strings written into the cells. This is the part that's driving me nuts: IF I WRITE THE SAME STRINGS DIRECTLY TO A SPREADSHEET, IT WORKS! But if I write the data read in from the XML file, it's corrupt. I can't figure it out; maybe you can. My automatically generated system details are as follows: Perl version : 5.006001 OS name : solaris Module versions: (not all are required) Spreadsheet::WriteExcel 2.17 Parse::RecDescent 1.94 File::Temp 0.17 OLE::Storage_Lite 0.14 IO::Stringy 2.110 The original program imports an XML representation of a Checkpoint FW-1 rulebase and outputs a spreadsheet. I have removed all formatting and extraneous fields, both from the original program and from the data set, for simplicity. I boiled it down to the minimal bad data set, attached as BAD.xml. If you remove just one fake IP from that list, it works OK. I have included that file as GOOD.xml. The program, included as generate.pl, takes an XML file as its one argument, and outputs a spreadsheet file of the same name with extension .xls. In case you cannot run the program for some reason (XML::Simple is non-trivial to get working), I have attached result spreadsheets GOOD.xls and BAD.xls. All files are attached in a small .tar.gz file. Let me know if I can provide any other samples or information. This is an excellent little tool and I'd jlike to be able to use it for my project. jd
Download bugreport.tar.gz
application/x-tar-gz 1.6k

Message body not shown because it is not plain text.

Hi JD, Thanks for your very detailed report. This is a known bug when using Spreadsheet::WriteExcel with XML data on Perl 5.6. It is explained in detail here with some suggested workarounds: Warning about XML::Parser and Perl 5.6 http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm#Warning_about_XML%3A%3AParser_and_Perl_5.6 You clearly put some effort into debugging this yourself and I'm sorry that you were frustrated by it. John. --
Subject: Re: [rt.cpan.org #22934] WriteExcel: generates bad Excel files
Date: Fri, 10 Nov 2006 18:37:13 -0500
To: via RT <bug-Spreadsheet-WriteExcel [...] rt.cpan.org>
From: "J.D. Baldwin" <baldwin [...] panix.com>
Show quoted text
> Hi JD, > > Thanks for your very detailed report. > > This is a known bug when using Spreadsheet::WriteExcel with XML data on > Perl 5.6. > > It is explained in detail here with some suggested workarounds: > > Warning about XML::Parser and Perl 5.6 > http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm#Warning_about_XML%3A%3AParser_and_Perl_5.6 > > > You clearly put some effort into debugging this yourself and I'm sorry > that you were frustrated by it.
Thanks. I've got a 5.8.8 installation going with total success, but that's no an option on the production platform ... I'll look into the workaround. jd
I'm closing this because it isn't strictly a Spreadsheet::WriteExcel problem. It is more related to Perl56's handling, or non-handling, of UTF-8.