in reply to Re: Spradsheet Parsing problem
in thread Spreadsheet Parsing problem


This starts to look like a bug in Spreadsheet::WriteExcel::Simple or Spreadsheet::WriteExcel to me

The following example might clarify what is happening:

#!/usr/bin/perl -w use strict; use Spreadsheet::WriteExcel; my $workbook = Spreadsheet::WriteExcel->new("reload.xls"); my $worksheet = $workbook->addworksheet(); my $format = $workbook->addformat(text_wrap=> 1); my $str = "A\nB\nC"; $worksheet->write('B2', $str ); $worksheet->write('B4', $str, $format);

This produces an Excel file that looks a little like this except the square described by artist is shown as an underline:

------------------------------------------ | | A | B | C | D | ... ------------------------------------------ | 1 | | | | | ... | 2 | | A_B_C | | | ... | 3 | | | | | ... | | | A | | | ... | | | B | | | ... | 4 | | C | | | ... | 5 | | | | | ... | 6 | | | | | ... |...| ... | ... | ... | ... | ...

The difference is caused by the presence of the format (which is missing from artist's code). This can also be verified within Excel by toggling the Format->Cells->Alignment->Wrap Text option.

As such, I don't think that this is a bug. :-)

And just to clarify a point raised in some of the other nodes. The character required to generate a wrap is \n (0x0A) and not \r (0x0D). Here is a hexdump of the wrapped ABC string taken from a real Excel file:

41 0a 42 0a 43
--
John.