hello.
i'm using activeperl version 5.6 and spreadsheet::parseexcel version 0.2603
i found the following problem to occur whenever a worksheet has more than one chart:
the parser behaves as if it fused sheets together, the next overwriting the first whenever cells in the next sheet are defined.
this results in data loss for the first sheet.
below is a simple example to illustrate the behavior:
1,2,3,4 is in the first sheet, a,b,c is in the next, we expect this:
--------- SHEET:Sheet1
( 0 , 0 ) -- 1
( 1 , 0 ) -- 2
( 2 , 0 ) -- 3
( 3 , 0 ) -- 4
--------- SHEET:Sheet2
( 0 , 0 ) -- a
( 1 , 0 ) -- b
( 2 , 0 ) -- c
instead we get the following (using the script below. and the file is attached if i find out how to)
--------- SHEET:Sheet1
( 0 , 0 ) -- a
( 1 , 0 ) -- b
( 2 , 0 ) -- c
( 3 , 0 ) -- 4
--------- SHEET:Sheet2
n.b. if you swap the positions of the two sheets, you get the correct behavior.
use strict;
use Spreadsheet::ParseExcel;
my $oBook = Spreadsheet::ParseExcel::Workbook->Parse('bench21.xls');
my($iR, $iC, $oWkS, $oWkC, $sheetnumber); $sheetnumber=0;
foreach my $oWkS (@{$oBook->{Worksheet}}) { $sheetnumber++;
print "--------- SHEET:", $oWkS->{Name}, "\n";
for(my $iR = $oWkS->{MinRow} ; defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) {
for(my $iC = $oWkS->{MinCol} ; defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) {
$oWkC = $oWkS->{Cells}[$iR][$iC];
print "( $iR , $iC ) -- ", $oWkC->Value, "\n" if($oWkC);
}
}
}
of course i could strip my files of all its graphics, but unless someone knows how to do that non-manually, i won't.
also, i noticed a rather similar bug report. the two could be linked, but its status is new... :(
(id 13273:Unable to parse Excel 2003 spreadsheet with charts containing external references)
thanks for any help
|