CubeField.LayoutForm 属性 (Excel)CubeField.LayoutForm property (Excel)

返回或设置指定的数据透视表项的显示的方式 — 以表格格式还是以分级显示格式。Returns or sets the way the specified PivotTable items appear—in table format or in outline format. 读/写**xlLayoutFormType**。Read/write xlLayoutFormType.

语法Syntax

表达式expression. LayoutForm

_表达式_一个代表CubeField对象的变量。expression A variable that represents a CubeField object.

备注Remarks

| xlLayoutFormType可为以下xlLayoutFormType常量之一。 ||xlTabular| xlLayoutFormType can be one of these xlLayoutFormType constants.| | xlTabular. 默认。 ||xlOutlineDefault.| | xlOutline. LayoutSubtotalLocation 属性指定分类汇总在数据透视表报表中显示的位置。 |The LayoutSubtotalLocation property specifies where the subtotal appears in the PivotTable report.|

您可以设置该属性的任何数据透视表字段;但是,格式才会显示指定的字段是行字段之外的最里层 (最低级) 的行字段。You can set this property for any PivotTable field; however, the formatting appears only if the specified field is a row field other than the innermost (lowest-level) row field. 对于非 OLAP 数据源时重新排列字段, 或添加到或数据透视表报表中删除时,不会更改此属性的值。For non-OLAP data sources, the value of this property doesn't change when the field is rearranged or when it is added to or removed from the PivotTable report.

示例Example

本示例以分级显示格式显示当前活动工作表上第一个数据透视表中的状态字段,然后在该字段顶部显示分类汇总。This example displays the state field in the first PivotTable report on the active worksheet in outline format, and it displays the subtotals at the top of the field.

With ActiveSheet.PivotTables("PivotTable1") _ 
 .PivotFields("state") 
 .LayoutForm = xlOutline 
 .LayoutSubtotalLocation = xlTop 
End With

另请参阅See also

CubeField 对象CubeField Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.