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: 5431
Status: resolved
Priority: 0/
Queue: Spreadsheet-WriteExcel

People
Owner: jmcnamara [...] cpan.org
Requestors: asad_ali1 [...] yahoo/com
Cc:
AdminCc:

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



Subject: Leading zero gets dropped off
Tried on 1. perl, v5.8.0 built for MSWin32-x86-multi-thread on W2K and WIN ME 2. perl, v5.6.0 built for sun4-solaris on SunOS 7 5.5.1 Generic_103640-42 (Solaris 2.5.1) Used: Spreadsheet-WriteExcel-0.42 Snippet Code Used: use Spreadsheet::WriteExcel::Big; $XXX = $ARGV[0]; # passed 0010010 $workbook = Spreadsheet::WriteExcel::Big->new('test.xls'); $CharFormat = $workbook->addformat(); $CharFormat->set_num_format('@'); $worksheet = $workbook->add_worksheet(); $worksheet->write($row, $iCounter, $XXX, $CharFormat); $workbook->close(); Though the column is formatted as text, but leading zero's are dropped. If " " is prefix or postfixed, it works
From: Asad_ali1 [...] yahoo.com
Hi: Wondering if the fix is some thing that I can apply at my end or do I have to wait for the next release. FYI I am novice when it comes to perl. Thanks Ps. Sorry about the typo in the email earlier. [guest - Tue Feb 24 09:25:44 2004]: Show quoted text
> Tried on > 1. perl, v5.8.0 built for MSWin32-x86-multi-thread on W2K and WIN ME > 2. perl, v5.6.0 built for sun4-solaris on SunOS 7 5.5.1 > Generic_103640-42 (Solaris 2.5.1) > > Used: Spreadsheet-WriteExcel-0.42 > > Snippet Code Used: > > use Spreadsheet::WriteExcel::Big; > $XXX = $ARGV[0]; # passed 0010010 > $workbook = Spreadsheet::WriteExcel::Big->new('test.xls'); > $CharFormat = $workbook->addformat(); > $CharFormat->set_num_format('@'); > $worksheet = $workbook->add_worksheet(); > $worksheet->write($row, $iCounter, $XXX, $CharFormat); > $workbook->close(); > > Though the column is formatted as text, but leading zero's are > dropped. If " " is prefix or postfixed, it works
The above solution involving keep_leading_zeros() is available in the current release.
Subject: Spreadsheet-WriteExcel: Leading zero gets dropped off
First off, my apologies. I posted a response as a "comment" instead of a "reply" so you probably didn't see it. Here is the original message for the record. This isn't a bug. It is mainly a feature of the way Excel behaves. There is a explanation of why this happens and how to avoid it in the keep_leading_zeros() section of the Spreadsheet::WriteExcel documentation. See: http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/WriteExcel.pm#keep_leading_zeros() John. --