Add a Pivot table grouping

Dear Aspose Team,

Please let me know if we can add a grouping in a pivot table using Aspose.cells v6. In Excel, the functionality can be accomplished by right clicking the pivot field and create a grouping or by using Data> Grouping tab.

Please let me know if there is an equivalent api for this.

Thanks,

Hi,


I think you may try to use Aspose.Cells Grouping rows/cols feature for your requirement, see the document for your reference:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/groupingungrouping-rows-and-columns.html

Thank you.

Thanks Amjad for the reply.

I would like to know if a grouping in a pivot table is possible, as against the grouping of rows/columns.
By this, I meant that set of values in a pivot table be grouped to a new value.

Thanks again

Hi,


Well, I am afraid, the direct PivotTable grouping feature is not available at the moment. I have logged your feature request with an id: CELLSNET-29407. We will look into it later on.

thank you.

Thanks Amjad for your reply. Please let me know when this feature will be included.

Thanks

Hi,


We will try to support this feature before the end of next month. Once it is supported, we will let you know here.

Thanks and keep in touch.

Thanks Amjad for your reply. I would be awaiting for it .

Thanks,

Hi,

We have fixed this issue. Please download: Aspose.Cells for .NET v7.0.0.1

C#


//set autogroup field

pivotTable.SetAutoGroupField(0);


//set manual group field

ArrayList list = new ArrayList();

list.Add(PivotGroupByType.RangeOfValues);

pivotTable.SetManualGroupField(0, 2, 5, list, 2);



list = new ArrayList();

list.Add(PivotGroupByType.Years);

DateTime start = new DateTime(1930, 6, 2);

DateTime end = new DateTime(1931, 9, 10);

pivotTable.SetManualGroupField(0, start, end, list, 1);


//ungroup

pivotTable.SetUngroup(0);