XSL - Modify XML Export to Excel to resize columns -
i'm using xsl file modify xml file generate excel spreadsheet - working increase width of columns. can't use the:
<xsl:attribute name="ss:autofitwidth">1</xsl:attribute>
option columns being generated text contain mix of text, numbers , dates, , docs xml spreadsheet reference mentions use of means 'column should autosized numeric , date values only. not autofit textual values.' that's not option.
does know way have columns resized or specify value width of column can @ least increase width more closely reflect content in each column?
here's current xml:
<?xml version="1.0" encoding="utf-8"?> <fmpxmlresult xmlns="http://www.filemaker.com/fmpxmlresult"> <errorcode>0</errorcode> <product build="06-06-2017" name="filemaker" version="proadvanced 16.0.2"/> <metadata> <field emptyok="yes" maxrepeat="1" name="columna" type="text"/> <field emptyok="yes" maxrepeat="1" name="columnb" type="text"/> <field emptyok="yes" maxrepeat="1" name="columnc" type="text"/> <field emptyok="yes" maxrepeat="1" name="columnd" type="text"/> <field emptyok="yes" maxrepeat="1" name="columne" type="text"/> <field emptyok="yes" maxrepeat="1" name="flagbold" type="text"/> </metadata> <resultset found="6"> <row modid="0" recordid="900"> <col> <data>created: 15-august-2017</data> </col> <col> <data/> </col> <col> <data/> </col> <col> <data/> </col> <col> <data/> </col> <col> <data>1</data> </col> </row> <row modid="0" recordid="901"> <col> <data/> </col> <col> <data/> </col> <col> <data/> </col> <col> <data/> </col> <col> <data/> </col> <col> <data/> </col> </row> <row modid="1" recordid="902"> <col> <data>name</data> </col> <col> <data>id</data> </col> <col> <data>category</data> </col> <col> <data>number</data> </col> <col> <data>amount</data> </col> <col> <data>1</data> </col> </row> <row modid="1" recordid="904"> <col> <data>acme corp pty ltd</data> </col> <col> <data>123456</data> </col> <col> <data>category 1</data> </col> <col> <data>1</data> </col> <col> <data>$456.78</data> </col> <col> <data/> </col> </row> <row modid="1" recordid="905"> <col> <data>demo company pty ltd</data> </col> <col> <data>987654</data> </col> <col> <data>category 2</data> </col> <col> <data>1</data> </col> <col> <data>$789.32</data> </col> <col> <data/> </col> </row> </resultset> </fmpxmlresult>
and here's xsl creates spreadsheet rows:
<style ss:id="mytitlestyle"> <alignment ss:wraptext="0" /> <font ss:bold="1"/> </style> <xsl:for-each select="fmp:fmpxmlresult/fmp:resultset/fmp:row"> <row> <xsl:for-each select="fmp:col"> <cell> <xsl:if test="../fmp:col[6]/fmp:data = 1"> <xsl:attribute name="ss:styleid">mytitlestyle</xsl:attribute> </xsl:if> <data ss:type="string"> <xsl:value-of select="." /> </data> </cell> </xsl:for-each><!-- next column --> </row> </xsl:for-each><!-- next row -->
Comments
Post a Comment