API Reference
PivotTableBuilder
Fluent builder for creating pivot tables from an A1 source range.
Inheritance
- Object
- PivotTableBuilder
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Method ExcelSheet.Pivot
- Method PivotTableBuilder.Average
- Method PivotTableBuilder.CalculatedField
- Method PivotTableBuilder.Captions
- Method PivotTableBuilder.Columns
- Method PivotTableBuilder.Count
- Method PivotTableBuilder.DateGroup
- Method PivotTableBuilder.DateHierarchy
- Method PivotTableBuilder.Display
- Method PivotTableBuilder.FieldBreaks
- Method PivotTableBuilder.FieldDisplay
- Method PivotTableBuilder.FieldLayout
- Method PivotTableBuilder.FieldNumberFormat
- Method PivotTableBuilder.FieldNumberFormatId
- Method PivotTableBuilder.FieldOptions
- Method PivotTableBuilder.Filter
- Method PivotTableBuilder.Filters
- Method PivotTableBuilder.GrandTotals
- Method PivotTableBuilder.Group
- Method PivotTableBuilder.HideItems
- Method PivotTableBuilder.Layout
- Method PivotTableBuilder.Max
- Method PivotTableBuilder.Min
- Method PivotTableBuilder.NumberGroup
- Method PivotTableBuilder.Pages
- Method PivotTableBuilder.PercentOfTotal
- Method PivotTableBuilder.Rows
- Method PivotTableBuilder.SelectPageItem
- Method PivotTableBuilder.ShowOnlyItems
- Method PivotTableBuilder.SortField
- Method PivotTableBuilder.Style
- Method PivotTableBuilder.SubtotalCaption
- Method PivotTableBuilder.Subtotals
- Method PivotTableBuilder.SubtotalsAtTop
- Method PivotTableBuilder.Sum
- Method PivotTableBuilder.Value
Methods
public ExcelSheet At(String destinationCell, String name = null) #ExcelSheetCreates the pivot table at the destination cell and returns the source sheet.
Parameters
- destinationCell System.String
- name System.String = null
public PivotTableBuilder Average(String fieldName, String displayName = null, String numberFormat = null) #PivotTableBuilderAdds an Average data field.
Parameters
- fieldName System.String
- displayName System.String = null
- numberFormat System.String = null
public PivotTableBuilder CalculatedField(String name, String formula, String caption = null, Nullable<UInt32> numberFormatId = null, String numberFormat = null) #PivotTableBuilderAdds a formula-backed calculated pivot field.
Parameters
- name System.String
- formula System.String
- caption System.String = null
- numberFormatId System.Nullable{System.UInt32} = null
- numberFormat System.String = null
public PivotTableBuilder Captions(String rowHeader = null, String columnHeader = null, String grandTotal = null, String missing = null, String error = null) #PivotTableBuilderSets pivot table captions.
Parameters
- rowHeader System.String = null
- columnHeader System.String = null
- grandTotal System.String = null
- missing System.String = null
- error System.String = null
public PivotTableBuilder Columns(params String[] fieldNames) #PivotTableBuilderAdds one or more column fields by source header name.
Parameters
- fieldNames System.String[]
public PivotTableBuilder Count(String fieldName, String displayName = null, String numberFormat = null) #PivotTableBuilderAdds a Count data field.
Parameters
- fieldName System.String
- displayName System.String = null
- numberFormat System.String = null
public PivotTableBuilder DateGroup(String fieldName, GroupByValues groupBy, Nullable<DateTime> startDate = null, Nullable<DateTime> endDate = null, Nullable<Double> interval = null) #PivotTableBuilderAdds date grouping metadata for a pivot field.
Parameters
- fieldName System.String
- groupBy DocumentFormat.OpenXml.Spreadsheet.GroupByValues
- startDate System.Nullable{System.DateTime} = null
- endDate System.Nullable{System.DateTime} = null
- interval System.Nullable{System.Double} = null
public PivotTableBuilder DateHierarchy(String fieldName, params GroupByValues[] levels) #PivotTableBuilderAdds generated date hierarchy fields for a pivot field, such as years, quarters, and months.
Parameters
- fieldName System.String
- levels DocumentFormat.OpenXml.Spreadsheet.GroupByValues[]
public PivotTableBuilder Display(Nullable<Boolean> dataOnRows = null, Nullable<Boolean> showHeaders = null, Nullable<Boolean> showEmptyRows = null, Nullable<Boolean> showEmptyColumns = null, Nullable<Boolean> showDrill = null, Nullable<Boolean> showDataDropDown = null, Nullable<Boolean> showDropZones = null, Nullable<Boolean> showDataTips = null, Nullable<Boolean> showMemberPropertyTips = null, Nullable<Boolean> fieldListSortAscending = null, Nullable<Boolean> customListSort = null) #PivotTableBuilderControls common pivot display flags.
Parameters
- dataOnRows System.Nullable{System.Boolean} = null
- showHeaders System.Nullable{System.Boolean} = null
- showEmptyRows System.Nullable{System.Boolean} = null
- showEmptyColumns System.Nullable{System.Boolean} = null
- showDrill System.Nullable{System.Boolean} = null
- showDataDropDown System.Nullable{System.Boolean} = null
- showDropZones System.Nullable{System.Boolean} = null
- showDataTips System.Nullable{System.Boolean} = null
- showMemberPropertyTips System.Nullable{System.Boolean} = null
- fieldListSortAscending System.Nullable{System.Boolean} = null
- customListSort System.Nullable{System.Boolean} = null
public PivotTableBuilder FieldBreaks(String fieldName, Nullable<Boolean> insertBlankRow = null, Nullable<Boolean> insertPageBreak = null) #PivotTableBuilderControls blank-row and page-break insertion after pivot field items.
Parameters
- fieldName System.String
- insertBlankRow System.Nullable{System.Boolean} = null
- insertPageBreak System.Nullable{System.Boolean} = null
public PivotTableBuilder FieldDisplay(String fieldName, Nullable<Boolean> showAll = null, Nullable<Boolean> showDropDowns = null, Nullable<Boolean> multipleItemSelectionAllowed = null, Nullable<Boolean> includeNewItemsInFilter = null) #PivotTableBuilderControls common pivot field display flags.
Parameters
- fieldName System.String
- showAll System.Nullable{System.Boolean} = null
- showDropDowns System.Nullable{System.Boolean} = null
- multipleItemSelectionAllowed System.Nullable{System.Boolean} = null
- includeNewItemsInFilter System.Nullable{System.Boolean} = null
public PivotTableBuilder FieldLayout(String fieldName, Nullable<Boolean> compact = null, Nullable<Boolean> outline = null) #PivotTableBuilderControls compact and outline layout flags for a pivot field.
Parameters
- fieldName System.String
- compact System.Nullable{System.Boolean} = null
- outline System.Nullable{System.Boolean} = null
public PivotTableBuilder FieldNumberFormat(String fieldName, String numberFormat) #PivotTableBuilderSets a number format code for a pivot field.
Parameters
- fieldName System.String
- numberFormat System.String
public PivotTableBuilder FieldNumberFormatId(String fieldName, UInt32 numberFormatId) #PivotTableBuilderSets a built-in or custom number format id for a pivot field.
Parameters
- fieldName System.String
- numberFormatId System.UInt32
public PivotTableBuilder FieldOptions(params ExcelPivotFieldOptions[] options) #PivotTableBuilderAdds field-level display, sort, format, and item-filter options.
Parameters
- options OfficeIMO.Excel.ExcelPivotFieldOptions[]
public PivotTableBuilder Filter(params ExcelPivotFilter[] filters) #PivotTableBuilderAdds label or value filters to the pivot table.
Parameters
- filters OfficeIMO.Excel.ExcelPivotFilter[]
public PivotTableBuilder Filters(params String[] fieldNames) #PivotTableBuilderAdds one or more page/filter fields by source header name.
Parameters
- fieldNames System.String[]
public PivotTableBuilder GrandTotals(Boolean rows = true, Boolean columns = true) #PivotTableBuilderControls row and column grand totals.
Parameters
- rows System.Boolean = true
- columns System.Boolean = true
public PivotTableBuilder Group(params ExcelPivotGrouping[] groupings) #PivotTableBuilderAdds date or numeric grouping metadata for pivot fields.
Parameters
- groupings OfficeIMO.Excel.ExcelPivotGrouping[]
public PivotTableBuilder HideItems(String fieldName, params String[] items) #PivotTableBuilderHides specific source items for a pivot field.
Parameters
- fieldName System.String
- items System.String[]
public PivotTableBuilder Layout(ExcelPivotLayout layout) #PivotTableBuilderSets the pivot table layout.
Parameters
- layout OfficeIMO.Excel.ExcelPivotLayout
public PivotTableBuilder Max(String fieldName, String displayName = null, String numberFormat = null) #PivotTableBuilderAdds a Max data field.
Parameters
- fieldName System.String
- displayName System.String = null
- numberFormat System.String = null
public PivotTableBuilder Min(String fieldName, String displayName = null, String numberFormat = null) #PivotTableBuilderAdds a Min data field.
Parameters
- fieldName System.String
- displayName System.String = null
- numberFormat System.String = null
public PivotTableBuilder NumberGroup(String fieldName, Double interval, Nullable<Double> startNumber = null, Nullable<Double> endNumber = null) #PivotTableBuilderAdds numeric range grouping metadata for a pivot field.
Parameters
- fieldName System.String
- interval System.Double
- startNumber System.Nullable{System.Double} = null
- endNumber System.Nullable{System.Double} = null
public PivotTableBuilder Pages(params String[] fieldNames) #PivotTableBuilderAdds one or more page/filter fields by source header name.
Parameters
- fieldNames System.String[]
public PivotTableBuilder PercentOfTotal(String fieldName, String displayName = null, String numberFormat = "0.0%") #PivotTableBuilderAdds a Sum data field shown as a percentage of the pivot grand total.
Parameters
- fieldName System.String
- displayName System.String = null
- numberFormat System.String = "0.0%"
public PivotTableBuilder Rows(params String[] fieldNames) #PivotTableBuilderAdds one or more row fields by source header name.
Parameters
- fieldNames System.String[]
public PivotTableBuilder SelectPageItem(String fieldName, String item) #PivotTableBuilderSelects an item for a page/filter field and adds the field to the page area if needed.
Parameters
- fieldName System.String
- item System.String
public PivotTableBuilder ShowOnlyItems(String fieldName, params String[] items) #PivotTableBuilderShows only specific source items for a pivot field.
Parameters
- fieldName System.String
- items System.String[]
public PivotTableBuilder SortField(String fieldName, FieldSortValues sortType) #PivotTableBuilderSets the sort mode for a pivot field.
Parameters
- fieldName System.String
- sortType DocumentFormat.OpenXml.Spreadsheet.FieldSortValues
public PivotTableBuilder Style(String pivotStyleName) #PivotTableBuilderSets the pivot table style name, for example PivotStyleMedium9.
Parameters
- pivotStyleName System.String
public PivotTableBuilder SubtotalCaption(String fieldName, String caption) #PivotTableBuilderSets a custom subtotal caption for a pivot field.
Parameters
- fieldName System.String
- caption System.String
public PivotTableBuilder Subtotals(String fieldName, Boolean enabled = true) #PivotTableBuilderControls whether the pivot field uses its default subtotal.
Parameters
- fieldName System.String
- enabled System.Boolean = true
public PivotTableBuilder SubtotalsAtTop(String fieldName, Boolean enabled = true) #PivotTableBuilderControls whether subtotals are shown at the top for a pivot field.
Parameters
- fieldName System.String
- enabled System.Boolean = true
public PivotTableBuilder Sum(String fieldName, String displayName = null, String numberFormat = null) #PivotTableBuilderAdds a Sum data field.
Parameters
- fieldName System.String
- displayName System.String = null
- numberFormat System.String = null
public PivotTableBuilder Value(String fieldName, DataConsolidateFunctionValues function, String displayName = null, Nullable<UInt32> numberFormatId = null, String numberFormat = null, Nullable<ShowDataAsValues> showDataAs = null, Nullable<Int32> baseField = null, Nullable<UInt32> baseItem = null) #PivotTableBuilderAdds a data field using a specific aggregation function.
Parameters
- fieldName System.String
- function DocumentFormat.OpenXml.Spreadsheet.DataConsolidateFunctionValues
- displayName System.String = null
- numberFormatId System.Nullable{System.UInt32} = null
- numberFormat System.String = null
- showDataAs System.Nullable{DocumentFormat.OpenXml.Spreadsheet.ShowDataAsValues} = null
- baseField System.Nullable{System.Int32} = null
- baseItem System.Nullable{System.UInt32} = null
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object