Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I don't know the output of your XSL transformation: I will assume it's the xml format for Excel. Trying to reverse the process I wrote three numbers (007) in an Excel sheet: once as number, once as text and once as number but formatted to show 3 digits padded with zeros. Then I saved it as xml and looked at it. Here is the fragment:</p> <pre><code>&lt;Row&gt; &lt;Cell&gt;&lt;Data ss:Type="Number"&gt;7&lt;/Data&gt;&lt;/Cell&gt; &lt;/Row&gt; &lt;Row&gt; &lt;Cell&gt;&lt;Data ss:Type="String" x:Ticked="1"&gt;007&lt;/Data&gt;&lt;/Cell&gt; &lt;/Row&gt; &lt;Row&gt; &lt;Cell ss:StyleID="s22"&gt;&lt;Data ss:Type="Number"&gt;7&lt;/Data&gt;&lt;/Cell&gt; &lt;/Row&gt; </code></pre> <p>I'm not copying the style but you can easily do it.</p> <p>Edit: as always Google Is Your Friend (and mine, too ;-) ): <a href="http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm#CSVAndExcel" rel="nofollow noreferrer">http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm#CSVAndExcel</a>.</p> <p>Edit (2): I thought the link was enough. The article is saying that (if you are sure the target is <strong>only</strong> Excel) you can use an Excel-specific CSV syntax. So in your case and looking at your code I think you should <em>insert the missing commas</em> and change the opening</p> <pre><code>writer.WriteString("\""); </code></pre> <p>into</p> <pre><code>writer.WriteString("=\""); </code></pre> <p>Beware that I didn't try.</p> <p>Just one question out of curiosity: wouldn't it be simpler to just output what you need working on the DataSet instead of</p> <ul> <li>transforming it in XML</li> <li>generating an ad-hoc XSL</li> <li>performing the XSL transformation</li> <li>copying the result to the Response stream</li> </ul> <p>?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload