Message-ID: <66915522.9195.1711679369453.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9194_981813010.1711679369453" ------=_Part_9194_981813010.1711679369453 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Creates a new PivotTable for multiple consolidated ranges. A PivotTable =
created by this method is part of PivotTables
collection.
public PivotTable CreateConsolidatedPivotTable(IEnumerable<Area> data= , int row, int column)=20
Public Function CreateConsolidatedPivotTable(ByVal data As IEnumerable (of = Area), ByVal row As Integer, ByVal column As Integer) As PivotTable=20
SourceFields
will be created using the same algorithm that the=
Pivot Table Wizard in Excel uses to create Multiple Consolidation Pivot Ta=
bles.=20
ExcelApplication xla =3D new ExcelApplication(); Workbook wb =3D xla.Open(@"C:\MySpreadsheet.xlsx"); Worksheet ws =3D wb.Worksheets[0]; List<Area> areas =3D new List<Area>(); Area data =3D ws.CreateArea(0, 0, 10, 10); Area data2 =3D ws.CreateArea(12, 0, 5, 5); areas.Add(data); areas.Add(data2); PivotTable pt =3D ws.PivotTables.CreateConsolidatedPivotTable(areas, 11, 11= );=20
Dim xla As New ExcelApplication() Dim wb As Workbook =3D xla.Open("C:\MySpreadsheet.xlsx") Dim ws As Worksheet =3D wb.Worksheets(0) Dim areas As New List(of Area) Dim data As Area =3D ws.CreateArea(0, 0, 10, 10)Dim data2 As Area =3D ws.Cr= eateArea(0, 12, 5, 5)areas.Add(data);areas.Add(datas);Dim pt As PivotTable = =3D ws.PivotTables.CreatePivotTable(areas, 11, 11);=20