Excel导出的xml模板中怎么设置自适应行高属性?

兴齐 徐 0 Reputation points
2023-07-17T03:40:44.9366667+00:00

Excel导出的xml模板中怎么设置自适应行高属性?我添加

ss:AutoFitHeight="1" 没有生效
Microsoft 365 and Office Excel For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AllenXu-MSFT 24,941 Reputation points Moderator
    2023-07-17T07:22:03.9233333+00:00

    Hi @兴齐 徐,

    To set the adaptive row height attribute in the XML template exported by Excel, you can use the ss:ExpandedRowCount attribute. This attribute sets the number of rows that are visible in the worksheet. The adaptive height of the row is then calculated based on the content of the number of visible rows specified by this attribute.

    Here is an example. In yhis example, the ss:ExpandedRowCount attribute is set to 100, which means that the worksheet will display 100 rows.:

    <Worksheet ss:Name="Sheet1"> 
        <Table ss:ExpandedRowCount="100">        
        <!-- Table Content Here -->     
        </Table>
    </Worksheet>
    

    In addition to this attribute, you should also ensure that the ss:WrapText attribute is set to 1. This will ensure that the text wraps within a cell and adjusts the row height accordingly.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.