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

People
Owner: Nobody in particular
Requestors: philipp.soehnlein [...] nureg.de
Cc:
AdminCc:

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



Subject: filter_column expression with more than 2 valid values doesn't work
Date: Fri, 26 Aug 2016 11:27:42 +0200
To: bug-Spreadsheet-WriteExcel [...] rt.cpan.org
From: Philipp Söhnlein <philipp.soehnlein [...] nureg.de>
The documentation says the expression parameter in the filter_column function can have operators like `and` and also `or`, which I want to use to filter for multiple string values in a column. An example expression would be something like that: 'x = "FOO" or x = "BAR" or x = "BAZ"' This expression will croak with "Incorrect number of tokens in expression“, because the check there (https://github.com/jmcnamara/spreadsheet-writeexcel/blob/3df3f580b499fae1d4aeb5312fac31dba640ff7a/lib/Spreadsheet/WriteExcel/Worksheet.pm#L1068 <https://github.com/jmcnamara/spreadsheet-writeexcel/blob/master/lib/Spreadsheet/WriteExcel/Worksheet.pm#L1068>) only allows 3 or 7 tokens, but not more. Regards Philipp Söhnlein /// IT/Software-Development /// NUREG GmbH /// Dorfäckerstraße 31 | 90427 Nürnberg | Germany www.nureg.de Nürnberg HRB 22653 | USt.ID DE 814 685 653 COEs: Michael Schmidt, Stefan Boas
On Fri Aug 26 05:27:56 2016, philipp.soehnlein@nureg.de wrote: Show quoted text
> The documentation says the expression parameter in the filter_column > function can have operators like `and` and also `or`, which I want to > use to filter for multiple string values in a column. An example > expression would be something like that: > 'x = "FOO" or x = "BAR" or x = "BAZ"' > This expression will croak with "Incorrect number of tokens in > expression“, because the check there ... > only allows 3 or 7 tokens, but not more.
Hi, This is because Excel only allows 2 conditions in a custom filter. Therefore this expression isn't valid: 'x = "FOO" or x = "BAR" or x = "BAZ"' The error message could probably be a little better in this case. Note, if you want to do a filter with multiple equality items you should use the filter_column_list() method in Excel::Writer::XLSX (which is not available in S::WE (or, if I remember correctly, in the xls file format). John http://search.cpan.org/~jmcnamara/Excel-Writer-XLSX/lib/Excel/Writer/XLSX.pm#filter_column_list(_$column,_@matches_)