Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Excel line breaks not working.

From: LeonFord@-----------.---------.---
To: NULL
Date: 1/4/2006 8:22:00 AM
Ok, now that I know how to get the ampersand to show up in this post, I will 
try again.

Excel produces this line when I format the item the way I want it and save 
as XML, which is what I put into my XSL transformation file.
<Cell ss:StyleID="sHeaders"><Data 
ss:Type="String">Contract&#10;Value&#10;($M)</Data></Cell>

How do I get the transformation to produce this line?

"Leon Ford" wrote:

> I am doing an XSL transformation of a dataset (using a XmlDataDocument) to 
> create an Excel XML file.  Everything is working fine except that my header 
> cells are not getting the line breaks like I want.  
> 
> When I explicitly format the headers in excel the way I want them and save 
> the file as XML, the line built by excel is:
> 
> <Cell ss:StyleID="sHeaders"><Data 
> ss:Type="String">Contract
> Value
> ($M)</Data></Cell>
> 
> In my XSL transformation file, I have the following line:
> 
> <Cell ss:StyleID="sHeaders"><Data 
> ss:Type="String">Contract
> Value
> ($M)</Data></Cell>
> 
> When I do the transformation and save the XML file, the line produced is 
> (note the line wrap):
> 
> <Cell ss:StyleID="sHeaders"><Data ss:Type="String">Contract
> Value
> ($M)</Data></Cell>
> 
> When this is loaded into excel, the linebreaks are gone and the cell text is 
> all on the same line.
> 
> I have tried putting in the <xsl:preserve-space elements="*"/> into my XSL 
> transformation file, as well as XmlDataDocument.PreserveWhitespace = True 
> prior to doing the transformation in my code.  This does not help.
> 
> The bottom line, is that I need the final XML file to be exactly as show 
> below to have excel load this correctly.
> 
> <Cell ss:StyleID="sHeaders"><Data 
> ss:Type="String">Contract
> Value
> ($M)</Data></Cell>
> 
> 
> I am using Office 2003, Windows XP, and Visual Studio 2003.
> 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent