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.


In reply to Re: Re: Spreadsheet Parsing problem by jmcnamara
in thread Spreadsheet Parsing problem by artist

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.