|
next
|
Subject: Data in Excel not appearing properly after using format-number in xls Author: Rahul Vaid Date: 27 Jan 2006 12:51 AM
|
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
|
|
|
|