Click here to Skip to main content
16,011,804 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friend

I generate a excell sheet through xml so manually i write a style to design the cell of excell sheet but i am unable to fix the autosize of cell.

As we do in excell sheet manual,double click the cell corner of cell,then cell is auto fixed as content.

I write like this but its not working.

XML
-- <worksheet>
  --      <xsl:attribute name="ss:Name" xmlns:xsl="#unknown">ExcelTbl</xsl:attribute>
    --    &lt;!--<table ss:expandedcolumncount="29" xmlns:ss="#unknown">
    --       x:FullColumns="1" x:FullRows="1"&gt;--&gt;
 --       <table>
   --     <xsl:apply-templates select="ExcelTbl" xmlns:xsl="#unknown" />
   --     <column ss:autofitwidth="0" ss:width="18" />
      --  <row ss:index="2">
   --     <cell ss:index="2" ss:mergeacross="16" ss:styleid="m22638596" />
    --    <cell ss:mergeacross="1" ss:styleid="s89">
   --     <data ss:type="String">Q1</data>
    --    </cell>

   -- </row></table></table></worksheet>



So please try to give your opinion to fix this problem.
Posted
Updated 25-Jun-14 3:11am
v2

1 solution

Have a look here: XML Spreadsheet Reference[^]


MSDN wrote:
If this attribute (AutoFitWidth) is specified as True ("1"), it means that this column should be autosized for numeric and date values only. We do not autofit textual values.

If both ss:Width and ss:AutoFitWidth exist, the behavior is as follows:

ss:AutoFitWidth="1" and ss:Width is unspecified: Autofit the column width to fit the content.
ss:AutoFitWidth="1" and ss:Width is specified: Set the column to the specified width and only autofit if the size of the content is larger than the specified width.
ss:AutoFitWidth="0" and ss:Width is unspecified: Use the default column width.
ss:AutoFitWidth="0" and ss:Width is specified: Use the specified width.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900