@ya1yi2fa3,
Please use the following code to test it:
// Instantiating a Workbook object
Workbook workbook = new Workbook(filePath + @“Source.xlsx”);
// Obtaining the reference of the newly added worksheet
Worksheet sheet = workbook.Worksheets[0];
Cells cells = sheet.Cells;
Aspose.Cells.Pivot.PivotTableCollection pivotTables = sheet.PivotTables;
// Adding a PivotTable to the worksheet
int idx = pivotTables.Add("=A1:K5", “M12”, “PivotTable3”);
// Accessing the instance of the newly added PivotTable
Aspose.Cells.Pivot.PivotTable pivotTable = pivotTables[idx];
// Unshowing grand totals for rows.
pivotTable.RowGrand = true;
// Draging the first field to the row area.
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Row, 2);
// Draging the second field to the data area.
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Data, 6);
// Draging the third field to the data area.
pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Data, 5);
var valueID = pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Column, pivotTable.DataField);
pivotTable.PivotTableStyleType = Aspose.Cells.Pivot.PivotTableStyleType.PivotTableStyleLight16;
pivotTable.PivotTableStyleName = “PivotStyleLight16”;
//add this line to implement the feature.
pivotTable.ShowValuesRow = false;
// Saving the Excel file
workbook.Save(filePath + “out.xlsx”);
Let us know your feedback.