Hello,
I created a PivotTable .. but no data displayed... (see enclosed .xls)
I am running codes below..
need your help..
thanks & regards
// Pivot Table is here!
Worksheet sheet2 = workbook.Worksheets[workbook.Worksheets.Add()];
sheet2.Name = "PivotTable";
Aspose.Cells.Pivot.PivotTableCollection pivotTables = sheet2.PivotTables;
//Adding a PivotTable to the worksheet
int index = pivotTables.Add("=" + REPORTNAME + "!A1:E" + (row-1).ToString(), "B3", "PivotTable1");
//Accessing the instance of the newly added PivotTable
Aspose.Cells.Pivot.PivotTable pivotTable = pivotTables[index];
//Showing the grand totals
pivotTable.RowGrand = true;
//pivotTable.ColumnGrand = true;
//Setting the PivotTable report is automatically formatted
pivotTable.IsAutoFormat = true;
//Setting the PivotTable autoformat type.
pivotTable.AutoFormatType = Aspose.Cells.Pivot.PivotTableAutoFormatType.Classic;
//Draging the first field to the row area.
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Row, 0);
//Setting the number format of the first data field
//pivotTable.DataFields[0].NumberFormat = "$#,##0.00";
workbook.Save(xls);