[]
Represents a PivotTable report on a worksheet. The PivotTable object is a member of the PivotTables collection. The PivotTables collection contains all the PivotTable objects on a single worksheet.
public interface IPivotTable
Gets or sets a value that indicates whether a PivotField can have multiple filters applied to it at the same time.
bool AllowMultipleFilters { get; set; }
Returns an ICalculatedFields collection that represents all the calculated fields in the specified PivotTable report.
ICalculatedFields CalculatedFields { get; }
CalculatedFields
Returns an object that represents a collection of all the fields (an IPivotFields object) that are currently shown as column fields. Read-only.
IPivotFields ColumnFields { get; }
Gets or sets whether the PivotTable report shows grand totals for columns (read or write).
bool ColumnGrand { get; set; }
Returns a Range object that represents the range that contains the column area in the PivotTable report (read-only).
IRange ColumnRange { get; }
Returns or sets the indent increment for PivotItems when compact row layout form is turned on. Read/write.
int CompactRowIndent { get; set; }
Returns a Range object that represents the range that contains the data area in the list between the header row and the insert row (read-only).
IRange DataBodyRange { get; }
Returns an object that represents a collection of all the fields (an IPivotFields object) that are currently shown as data fields. Read-only.
IPivotFields DataFields { get; }
Returns or sets whether the pivotTable defer layout update.
bool DeferLayoutUpdate { get; set; }
Gets or sets whether tooltips are displayed for PivotTable cells (read or write).
bool DisplayContextTooltips { get; set; }
True if the PivotTable report displays a custom error string in cells that contain errors. The default value is False.
bool DisplayErrorString { get; set; }
Gets or sets whether to display member properties in tooltips.
bool DisplayMemberPropertyTooltips { get; set; }
True if the PivotTable report displays a custom string in cells that contain null values. The default value is True.
bool DisplayNullString { get; set; }
Returns or sets the string displayed in cells that contain errors when the PivotTable.DisplayErrorString property is True. The default value is an empty string (""). Read/write String.
string ErrorString { get; set; }
Gets or sets the text string label that is displayed in the grand total column or row heading in the specified PivotTable report. The default value is the string "Grand Total".
string GrandTotalName { get; set; }
This property specifies the layout settings for PivotFields when they are added to the PivotTable for the first time.
LayoutRowType LayoutRowDefault { get; set; }
True if the specified PivotTable report’s outer-row item, column item, subtotal, and grand total labels use merged cells.
bool MergeLabels { get; set; }
Gets or sets the name of the object.
string Name { get; set; }
Returns or sets the string displayed in cells that contain null values when the PivotTable.DisplayNullString property is True. The default value is an empty string ("").
string NullString { get; set; }
Returns or sets the order in which page fields are added to the PivotTable report’s layout. Can be one of the following Order constants: DownThenOver or OverThenDown. The default constant is DownThenOver.
Order PageFieldOrder { get; set; }
Returns an object that represents a collection of all the fields (an IPivotFields object) that are currently showing as page fields. Read-only.
IPivotFields PageFields { get; }
Returns or sets the number of page fields in each column or row in the PivotTable report.
int PageFieldWrapCount { get; set; }
Returns a Range object that represents the range that contains the page area in the PivotTable report.
IRange PageRange { get; }
Returns a PivotCache object that represents the cache for the specified PivotTable report.
IPivotCache PivotCache { get; }
Returns a PivotAxis object representing the entire column axis.
IPivotAxis PivotColumnAxis { get; }
Returns an object that represents either a single PivotTable field (a PivotField object) or a collection of both the visible and hidden fields (a PivotFields object) in the PivotTable report.
IPivotFields PivotFields { get; }
Returns a PivotFormulas object that represents the collection of formulas for the specified PivotTable report.
IPivotFormulas PivotFormulas { get; }
Returns a PivotAxis object representing the entire row axis.
IPivotAxis PivotRowAxis { get; }
Returns an object that represents either a collection of all the fields (an IPivotFields object) that are currently showing as row fields. Read-only.
IPivotFields RowFields { get; }
Gets or sets whether the PivotTable report shows grand totals for rows.
bool RowGrand { get; set; }
Returns a Range object that represents the range including the row area on the PivotTable report.
IRange RowRange { get; }
The PivotTable.ShowTableStyleColumnHeadersproperty is set to True if the coulmn headers should be displayed in the PivotTable.
bool ShowTableStyleColumnHeaders { get; set; }
The Boolean property displays banded columns in which even columns are formatted differently from odd columns. This makes PivotTableseasier to read.
bool ShowTableStyleColumnStripes { get; set; }
The Boolean property displays grand total columns style.
bool ShowTableStyleLastColumn { get; set; }
The PivotTable.ShowTableStyleRowHeaders property is set to True if the row headers should be displayed in the PivotTable.
bool ShowTableStyleRowHeaders { get; set; }
The PivotTable.ShowTableStyleRowStripes property displays banded rows in which even rows are formatted differently from odd rows. This makes PivotTables easier to read.
bool ShowTableStyleRowStripes { get; set; }
Gets or sets the style currently applied to the specified pivot table.
ITableStyle Style { get; set; }
Returns a Range object that represents the range containing the entire PivotTable report, but doesn’t include page fields.
IRange TableRange1 { get; }
Returns a Range object that represents the range containing the entire PivotTable report, including page fields.
IRange TableRange2 { get; }
Gets or sets the style used in the body of the PivotTable report. The default value is a null string (no style is applied by default).
string TableStyle { get; set; }
Gets or sets a string saved with the PivotTable report.
string Tag { get; set; }
Adds a data field to a PivotTable report. Returns a PivotField object that represents the new data field.
IPivotField AddDataField(IPivotField field, string caption, ConsolidationFunction function)
field
IPivotFieldThe unique field on the server. If the source data is Online Analytical Processing (OLAP), the unique field is a cube field. If the source data is non-OLAP (non-OLAP source data), the unique field is a PivotTable field.
caption
stringThe label used in the PivotTable report to identify this data field.
function
ConsolidationFunctionThe function performed in the added data field.
Deletes all filters currently applied to the PivotTable. This includes deleting all filters in the PivotFilters collection of the PivotTable object, removing any manual filtering applied, and setting all PivotFields in the Report Filter area to the default item.
void ClearAllFilters()
Clears a PivotTable. Clearing PivotTables includes removing all the fields and deleting all filtering and sorting applied to the PivotTables. This method resets the PivotTable to the state it had right after it was created, before any fields were added to it.
void ClearTable()
Retrieve the PivotValueCell object for a given PivotTable provided certain row and column indices.
IPivotValueCell PivotValueCell(int rowline, int columnline)
rowline
intThe row position in the data area.
columnline
intThe column position in the data area.
Refreshes the PivotTable report from the source data. Returns True if it’s successful.
bool Refresh()
Sets whether to repeat item labels for all PivotFields in the specified PivotTable.
void RepeatAllLabels(PivotFieldRepeatLabels repeat)
repeat
PivotFieldRepeatLabelsSpecifies whether to repeat item labels for all PivotFields in the specified PivotTable.
This method is used for simultaneously setting layout options for all existing PivotFields.
void SetRowAxisLayout(LayoutRowType rowLayout)
rowLayout
LayoutRowTypeSpecifies the type of layout row.
Changes the subtotal location for all existing PivotFields. Changing the subtotal location has an immediate visual effect only for fields in outline form, but it will be set for fields in tabular form as well.
void SubtotalLocation(SubtotalLocationType location)
location
SubtotalLocationTypeUpdates the link or PivotTable report.
void Update()