H
Harvey Schmidlapp
I have a script that generates an Excel file in XML. Everything is
working wonderfully except for one column where I want to embed line
feeds in the cells. It appears that the characters are there because
when I view the XML file in a text editor, the contents of those cells
are on separate lines but when I view the file in Excel, the line feed
character seems to be replaced with a single space.
So, for instance, I have:
<Row>
<Cell ss:StyleID="Default"><Data ss:Type="String">ABC Corp</Data></
Cell>
<Cell ss:StyleID="Default"><Data ss:Type="String">John Doe</Data></
Cell>
<Cell ss:StyleID="Default"><Data ss:Type="String">1234567</Data></
Cell>
<Cell ss:StyleID="Default"><Data ss:Type="String">Line Number 1
Line Number 2
Line Number 3
</Data></Cell>
</Row>
But, when opened in Excel, the last cell in the row looks like this:
Line Number 1 Line Number 2 Line Number 3
Wrapping is turned on and if I make the column narrow, it wraps but
not where the line feeds are (unless, of course I adjust it very
precisely -- that's not a solution, though because the text length
vary too much).
The character I'm putting in is an ASCII 10 -- chr(10) in Perl, which
is what's generating the XML.
Any ideas?
working wonderfully except for one column where I want to embed line
feeds in the cells. It appears that the characters are there because
when I view the XML file in a text editor, the contents of those cells
are on separate lines but when I view the file in Excel, the line feed
character seems to be replaced with a single space.
So, for instance, I have:
<Row>
<Cell ss:StyleID="Default"><Data ss:Type="String">ABC Corp</Data></
Cell>
<Cell ss:StyleID="Default"><Data ss:Type="String">John Doe</Data></
Cell>
<Cell ss:StyleID="Default"><Data ss:Type="String">1234567</Data></
Cell>
<Cell ss:StyleID="Default"><Data ss:Type="String">Line Number 1
Line Number 2
Line Number 3
</Data></Cell>
</Row>
But, when opened in Excel, the last cell in the row looks like this:
Line Number 1 Line Number 2 Line Number 3
Wrapping is turned on and if I make the column narrow, it wraps but
not where the line feeds are (unless, of course I adjust it very
precisely -- that's not a solution, though because the text length
vary too much).
The character I'm putting in is an ASCII 10 -- chr(10) in Perl, which
is what's generating the XML.
Any ideas?