PivotTable multiple data fields - move to column lables

Hi,

I have a PivotTable which has two data fields. When the excel file is generated I find the second data field is moved to Row Label, but I wanted it to be a column label. What method should I invoke to move from row label to column label. I couldnt find this anywhere in the documentation.

E.g.,

pivotTable.addFieldToArea(PivotFieldType.DATA, 5);
pivotTable.addFieldToArea(PivotFieldType.DATA, 6); - This field is placed under row labels, instead I wanted it to be under column labels.

Attached is the JAVA file and the generated excel file.

Below is the snapshot of issue and the corrected one

Regards

Sundhar

ManthanSystems

Hi,

In order to move your field into column labels, please try the following code.

Java


pivotTable.addFieldToArea(PivotFieldType.COLUMN, fieldIndex);

Hi

We have fixed this issue.

Please download and try the fix: Aspose.Cells for .NET v7.2.0.7

Please try the following sample code.

C#


PivotField data = pivotTable.DataField;

pivotTable.AddFieldToArea(PivotFieldType.Column, data);

or

pivotTable.ColumnFields.Add(pivotTable.DataField);//move datafied to columns


Hi,

To remaind, this topic was raised for JAVA platform.

Do you mind providing us the JAVA patch for this issue?

Sundhar

Hi,

Please download and try the java fix: Aspose.Cells for Java v7.2.0.7

Hi Shakeel, Thanks for the fix.

With this patch release this problem is resolved now.