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

People
Owner: jmcnamara [...] cpan.org
Requestors: dmacks [...] netspace.org
Cc:
AdminCc:

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



Subject: Cannot write() embedded newlines
Date: Mon, 5 Nov 2007 12:39:59 -0500
To: bug-Spreadsheet-WriteExcel [...] rt.cpan.org
From: Daniel Macks <dmacks [...] netspace.org>
Excel text cells can contain multiple lines by embedding newlines in the cell contents. If I create such a cell (alt-enter on Windows or I think cmd-control-return on Mac) and use Spreadsheet::ParseExcel, the value contains internal \n characters. Using Spreadsheet::WriteExcel to create that type of data doesn't seem to work. Using S::WE 2.18 on my OS X machine (perl5.8.1) or S::WE 2.20 on a RedHat box (perl5.8.8), both with OLE::Storage_Lite 0.14: use Spreadsheet::WriteExcel; my $wb=new Spreadsheet::WriteExcel("foo.xls"); my $ws=$wb->add_worksheet; $ws->write(0,0,"\a\rb"); $ws->write(1,0,"\a\nb"); both ways give me a single-line cell with a whitespace of some sort in the middle if I open the file on Excel from Office 2004 on OS X or a square box (unknown char of some sort?) on Windows Office 2003. How do I make this work correctly? dan -- Daniel Macks dmacks@netspace.org http://www.netspace.org/~dmacks
Hi, Thanks for the detailed report. Clearly you have some experience of receiving bug reports and know how you would like them to be. :-) In order to create multiple lines in a cell you need to set the text_wrap property of the cell. See the set_text_wrap() section of the docs and the text_wrap.pl program in the examples directory of the distro: http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/lib/Spreadsheet/WriteExcel.pm#set_text_wrap() http://search.cpan.org/src/JMCNAMARA/Spreadsheet-WriteExcel-2.20/examples/textwrap.pl There is also a Spreadsheet::WriteExcel Google Group if you have any further queries: http://groups.google.com/group/spreadsheet-writeexcel John. --