[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotCaches.Create

Create Method

Create(object)

Creates a new PivotCache from a source range or table.

Use this method to build a PivotCache that can later be used to create a PivotTable. The source data must be an IRange or an ITable.

Declaration
IPivotCache Create(object SourceData)
Function Create(SourceData As Object) As IPivotCache
Parameters
Type Name Description
object SourceData

The source data for the new PivotCache. This must be an IRange or an ITable; null is not supported.

Returns
Type Description
IPivotCache

A new IPivotCache created from the specified source data.

Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Region", "Sales"},
    {"East", 120},
    {"West", 150},
    {"East", 90}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
Exceptions
Type Condition
ArgumentException

If SourceData is not an IRange or an ITable.