Hello Team,
i want to pivot the table which is there on slide, below is the code for aspose.cells for pivot table, could you help me the same for aspose.slides
int gIndex = workBook.Worksheets.Add();
Worksheet groupSheet = workBook.Worksheets[gIndex];
Cells grpCells = groupSheet.Cells;
groupSheet.Name = “Call Summary Details”;
Aspose.Cells.Pivot.PivotTableCollection pivotTables = groupSheet.PivotTables;
string sourceHierachy = “=Call Summary Spread!” + colHeaders[0] + “1” + “:” + colHeaders[dtCallSummary.Columns.Count - 1] + (dtCallSummary.Rows.Count + 1).ToString();
Aspose.Cells.Pivot.PivotTable pivotTable;
try
{
int pIndex = pivotTables.Add(sourceHierachy, “A1”, “PT1”);
pivotTable = pivotTables[pIndex];
}
catch (Exception ex)
{
throw ex;
}
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Row, "Brick Description");
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Column, "Segment");
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Data, "TOTALCUSTOMERS");
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Data, "COVERAGE");
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Data, "FREQUENCY");
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Column, pivotTable.RowFields[pivotTable.RowFields.Count - 1]);
pivotTable.ColumnGrand = false;
pivotTable.RowGrand = false;
spreadSheet.IsVisible = false;
pivotTable.DataFields["COVERAGE"].NumberFormat = "#\\.00%";
pivotTable.DataFields["FREQUENCY"].NumberFormat = "#,##0";
Thanks in Advance.