Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Wiki Markup
{introducedin: 8.6.1

...

Description

Excerpt

Creates a new PivotTable for multiple consolidated ranges. A PivotTable created by this method is part of PivotTables collection.

Signature
C#C#
}
{description}
{excerpt}
Creates a new PivotTable for multiple consolidated ranges. A PivotTable created by this method is part of {{[EW8:PivotTables]}} collection.
{excerpt}
{signature:C#}
public PivotTable CreateConsolidatedPivotTable(IEnumerable<Area> data, int row, int column)
Signature
{signature}
{signature:vb.net
vb.net
}
Public Function CreateConsolidatedPivotTable(ByVal data As IEnumerable (of Area), ByVal row As Integer, ByVal column As Integer) As PivotTable
Parameters

...

The data that is represented within the PivotTable.

...

The 0-based number of the row of the upper left corner of the PivotTable.

...

The 0-based number of the column of the upper left corner of the PivotTable.

Remarks

This constructor will create Row, Column, and Value as ?SourceFields.  These ?SourceFields will be created using the same algorithm that the Pivot Table Wizard in Excel uses to create Multiple Consolidation Pivot Tables.

{signature}

{parameters}
{param:data}
The data that is represented within the PivotTable.
{param}
{param:aRow}
The 0-based number of the row of the upper left corner of the PivotTable.
{param}
{param:aColumn}
The 0-based number of the column of the upper left corner of the PivotTable.
{param}
{remarks}This constructor will create Row, Column, and Value&nbsp;as&nbsp;?[EW8:SourceField]s. &nbsp;These&nbsp;?{{SourceFields}} will be created using the same algorithm that the Pivot Table Wizard in Excel uses to create Multiple Consolidation Pivot Tables.

{remarks}


{example}
{code:csharp|title=C#}
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Open(@"C:\MySpreadsheet.xlsx");
Worksheet ws = wb.Worksheets[0];
List<Area> areas = new List<Area>();
Area data = ws.CreateArea(0, 0, 10, 10);
Area data2 = ws.CreateArea(12, 0, 5, 5);
areas.Add(data);
areas.Add(data2);
PivotTable pt = ws.PivotTables.CreateConsolidatedPivotTable(areas, 11, 11);
{code}
{code:vbnet|title=vb.net
}
Dim xla As New ExcelApplication()
Dim wb As Workbook = xla.Open("C:\MySpreadsheet.xlsx")
Dim ws As Worksheet = wb.Worksheets(0)
Dim areas As New List(of Area)
Dim data As Area = ws.CreateArea(0, 0, 10, 10)Dim data2 As Area = ws.CreateArea(0, 12, 5, 5)areas.Add(data);areas.Add(datas);Dim pt As PivotTable = ws.PivotTables.CreatePivotTable(areas, 11, 11);
{code}
{example}
Example
Code Block
csharpcsharp
titleC#
Code Block
vbnetvbnettitle