show multi-line text value in cells of an XML excel document made with C# XmlWriter

sparundicmoy

New Member
The Situation: I'm creating a C# .Net 4.0 Winform to collect a datatable from an Oracle DB using filters chosen by the user and putting them into a Gridview Preview to check out. Once they have filtered the data to their liking they click an export button which converts the datatable into an XML document that opens in Excel when double clicked. Inside the XML excel file each record looks like so:\[code\] <ss:Row> <ss:Cell ss:StyleID="General"> <ss:Data ss:Type="String">110002</ss:Data> </ss:Cell> <ss:Cell ss:StyleID="General"> <ss:Data ss:Type="String">GALV.047M X 3 G90 A653 PASSDRY SQ GR33</ss:Data> </ss:Cell> <ss:Cell ss:StyleID="General"> <ss:Data ss:Type="String">.047 MIN X 3 X COIL!GALV G90 ASTM A 653 SQ GR33 PASS DRY*20" ID5 TON MAX LIFTSKID EYE TO THE SKY3" X 3" SPACER IN BETWEEN EACH BUNDLESUPPLY TEST REPORTS CHEMICAL</ss:Data> </ss:Cell> </ss:Row>\[/code\]Which displays records in excel similar to how you would seem them if the file were a CVS, a completly unformatted worksheet with all text on a single line. Clearly inside the XML file the line breaks are preserved, but the excel sheet is meant for users to edit the data so I need to display the text how I recieve it (ie. on multiple lines if that is the case).The Question: How can I format the exported XML file to display it's cell contents on multiple lines (and perhaps increase cell hight to match) if that is how the data in the XML file is formatted?
 
Back
Top