Data in Excel file not appearing properly after using format-number in xls

Hi,

Initially the data that was appearing in my Excel sheet was shown properly.

This data was exported in servlet using :

res.setHeader("Content-type","application/xls");

res.setHeader("Content-disposition","inline; filename="abc.csv");

And at this time my XLS was having the columns as

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:output method="text" indent="no"/>

<xsl:template match="/">

CCY Pair,CCY 1,Average Rate,CCY 2,P&L (USD)

<xsl:apply-templates select="/response/tables/positions/row"/>

</xsl:template>

<xsl:template match="row">

<xsl:value-of select="currencyPair" />,<xsl:value-of select="contractAmount" />,<xsl:value-of select="contractRate"/>,<xsl:value-of select="counterAmount"/>,<xsl:value-of select="gainLoss"/>

<xsl:text> </xsl:text>

But the moment I used format-number ( ie This format-number has inserted a comma inside my data) as a result of which the the data after comma appears in seperate column.But this I suppose is the csv property to treat every data after comma as seperate data.

<xsl:value-of select="substring(currencyPair,1,3)"/>/<xsl:value-of select="substring(currencyPair,5,3)"/>,<xsl:value-of select="format-number(contractAmount,'###,###.##')"/>,<xsl:value-of select="format-number(contractRate,'###,###.######')"/>,<xsl:value-of select="format-number(counterAmount,'###,###.##')"/>,<xsl:value-of select="format-number(gainLoss,'###,###.##')"/>

Please help me out in this.

Thanx in advance.

Rahul

[1731 byte] By [vaidrahul2002a] at [2007-10-2 10:43:59]
# 1
Yes, CSV means Comma Separated Values. So those commas are going to be separators. If you don't want them to be separators then don't put them there.
DrClapa at 2007-7-13 2:54:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...