xml - Does ss:AutoFitHeight work for text? -
i have xml file save .xls
work on in excel:
<results> <result> <companyname>fnatic</companyname> <serviceid>1045</serviceid> <startdate>01-01-2014 00:00:00</startdate> <enddate>01-02-2014 00:00:00</enddate> <hours>1</hours> <description>couple of paragraphs of text. 3 of them.</description> </result> ... more results </results>
i use excel xml define structure , styles of xml data. thing left make "description" cell, merged set of columns, adjust height automatically amount of text in it. ss:row
seems have ss:autofitheight
. no changes happen resulting .xls
file when utilize them. ss:autofitheight
not work text ss:autofitwidth
doesn't work text in ss:column
?
... rest of typical declarations <xsl:template match="results"> <styles> <style ss:id="default" ss:name="normal"> <alignment ss:vertical="top" /> <borders /> <font /> <interior /> <numberformat /> <protection /> </style> <style ss:id="s1"> <font ss:size="10" ss:bold="1" /> <interior ss:color="#cef2ce" ss:pattern="solid" /> <alignment ss:horizontal="right" ss:vertical="top" /> </style> <style ss:id="s2"> <interior ss:color="#c0c0c0" ss:pattern="solid" /> </style> </styles> <worksheet ss:name="worksheet"> <table x:fullcolumns="1" x:fullrows="1"> <column ss:width="77" /> <column ss:width="65" /> <column ss:width="246" /> <column ss:width="26" /> <xsl:apply-templates select="result" /> <row><!-- last row --> <cell ss:index="3"><data ss:type="string">total:</data></cell> <cell ss:formula="=sum(r[-{count(result)}]c:r[-1]c)"> <data ss:type="number"></data> </cell> </row> </table> </worksheet> </xsl:template> <xsl:template match="result"> <row> <xsl:apply-templates select="serviceid" /> <xsl:apply-templates select="hours" /> </row> <row ss:autofitheight="1"> <xsl:apply-templates select="description" /> </row> </xsl:template> <xsl:template match="serviceid"> <cell ss:styleid="s1"> <data ss:type="string">service id:</data> </cell> <cell ss:styleid="s2"> <data ss:type="number"> <xsl:value-of select="."/> </data> </cell> </xsl:template> <xsl:template match="description"> <cell ss:styleid="s1"> <data ss:type="string">description:</data> </cell> <cell ss:mergeacross="2"> <data ss:type="string"> <xsl:value-of select="."/> </data> </cell> </xsl:template> <xsl:template match="hours"> <cell ss:styleid="s1"> <data ss:type="string">hours:</data> </cell> <cell ss:styleid="s2"> <data ss:type="number"> <xsl:value-of select="."/> </data> </cell> </xsl:template>
removing default row height on column properties counterintuitive , seems contradict specifications (https://msdn.microsoft.com/en-us/library/office/aa140066(v=office.10).aspx#odc_xmlss_ss:row), helps.
Comments
Post a Comment