动态生成时如何设置自动调整excell表格的单元格 [英] How to set autosize the cell of excell sheet when generate dynamically

查看:240
本文介绍了动态生成时如何设置自动调整excell表格的单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友



我通过xml生成一个excell表,所以手动我写一个样式来设计excell表格的单元格,但我无法修复自动调整大小单元格。



正如我们在excell表格手册中所做的那样,双击单元格的单元格角,然后单元格自动固定为内容。



我这样写但是没有用。



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.

-- <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.

推荐答案

看看这里: XML电子表格参考 [ ^ ]





Have a look here: XML Spreadsheet Reference[^]


MSDN写道:

如果这个属性( AutoFitWidth )被指定为 True(1),这意味着该列应该仅为数值和日期值自动调整我们不自动调整文字值。



如果 ss:Width ss:AutoFitWidth 存在,行为如下:



ss:AutoFitWidth =未指定1 ss:Width :自动调整列宽以适合内容。

ss:指定AutoFitWidth =1 ss:Width :将列设置为指定的宽度,如果大小为内容大于指定的宽度。

ss:AutoFitWidth =0 ss:宽度未指定:使用默认列宽。

ss:AutoFitWidth =0 ss:指定宽度:使用指定的宽度。

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.


这篇关于动态生成时如何设置自动调整excell表格的单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆