We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Cell Pivot Table

We have created a pivotTable.

We are dragging the fields we want to fieldArea and select the DATA option of the pivotTable like that :

pivotTable.addFieldToArea(PivotFieldType.DATA, 1);

but we want to change the way it is calculated. By default it provides a count of the dragged field.

We would like to use one of the summarize value field by of the value field Settings instead of the default one.

Ty.

Hi,


Well, you may try PivotField.setFunction() method to accomplish your task, see the sample code segment below for your reference:
e.g
Sample code:

pivotTable.getDataFields().get(index).setFunction(ConsolidationFunction.SUM);

Hope, this helps a bit.

Thank you.