#17 Workaround for Excel number esport outdside US, DE and HU

open
nobody
None
5
2010-02-13
2010-02-13
Anonymous
No

I've got a bug in number export to excel
Number masking outside US, DE, HU is wrong.
This is because java code-fixed selection of country in number masking creation (@mso-number-format).

I've developed my own workaround, in file jpivot/table/xls_mdxtable.xsl I've replaced this lines:
<xsl:attribute name="style">
<xsl:value-of select="concat('mso-number-format:',@mso-number-format)"/>
</xsl:attribute>

with this new lines:
<xsl:choose>
<xsl:when test= "@rawvalue != floor( @rawvalue )">
<xsl:attribute name="style">
<xsl:value-of select="concat('mso-number-format:','0.',substring('################',1,string-length(translate(@value,'\,.%','')) - string-length( format-number(@rawvalue ,'#'))))"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="style">mso-number-format: #</xsl:attribute>
</xsl:otherwise>
</xsl:choose>

This workaround works, but is not perfect: if does not group the numbers.
Obviously the perfect solution is not code-depending the selection of correct separators for country.

Discussion


Log in to post a comment.