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

Free Support Forum - aspose.com

Keep pivot's header order

The pivot loses header's order after working with input file. Attached screenshot with issue, input file and file with break.

Aspose.Cells version is 8.6.0.7

See code below:

C#

var workbook = new Workbook(@"C:\WrongPivotHeaderOrder.xlsx");
#region Data Block 0
var data0 = new object[,] { { new DateTime(2015, 1, 1) }, { new DateTime(2015, 1, 1) }, { new DateTime(2015, 1, 1) }, { new DateTime(2015, 1, 2) }, { new DateTime(2015, 1, 2) }, { new DateTime(2015, 1, 5) } };
#endregion
var worksheet0 = workbook.Worksheets[0];
worksheet0.Cells.ImportTwoDimensionArray(data0, 1, 0);
#region Data Block 1
var data1 = new object[,] { { "NameC" }, { "NameD" }, { "NameB" }, { "NameA" }, { "NameA" }, { "NameA" } };
#endregion
worksheet0.Cells.ImportTwoDimensionArray(data1, 1, 1);
#region Data Block 2
var data2 = new object[,] { { 100 }, { 200 }, { 300 }, { 100 }, { 150 }, { 350 } };
#endregion
worksheet0.Cells.ImportTwoDimensionArray(data2, 1, 2);
workbook.CalculateFormula();
var listobject0 = worksheet0.ListObjects[0];
listobject0.AutoFilter.Sorter.Sort();
var pivottable0 = worksheet0.PivotTables[0];
pivottable0.RefreshData();
pivottable0.CalculateData();
workbook.CalculateFormula();
workbook.Save(@"C:\result.xlsx");var workbook = new Workbook(@"C:\WrongPivotHeaderOrder.xlsx");
#region Data Block 0
var data0 = new object[,] { { new DateTime(2015, 1, 1) }, { new DateTime(2015, 1, 1) }, { new DateTime(2015, 1, 1) }, { new DateTime(2015, 1, 2) }, { new DateTime(2015, 1, 2) }, { new DateTime(2015, 1, 5) } };
#endregion
var worksheet0 = workbook.Worksheets[0];
worksheet0.Cells.ImportTwoDimensionArray(data0, 1, 0);
#region Data Block 1
var data1 = new object[,] { { "NameC" }, { "NameD" }, { "NameB" }, { "NameA" }, { "NameA" }, { "NameA" } };
#endregion
worksheet0.Cells.ImportTwoDimensionArray(data1, 1, 1);
#region Data Block 2
var data2 = new object[,] { { 100 }, { 200 }, { 300 }, { 100 }, { 150 }, { 350 } };
#endregion
worksheet0.Cells.ImportTwoDimensionArray(data2, 1, 2);
workbook.CalculateFormula();
var listobject0 = worksheet0.ListObjects[0];
listobject0.AutoFilter.Sorter.Sort();
var pivottable0 = worksheet0.PivotTables[0];
pivottable0.RefreshData();
pivottable0.CalculateData();
workbook.CalculateFormula();
workbook.Save(@"C:\result.xlsx");

Hi,

Thanks for your posting and using Aspose.Cells.

We were able to replicate this issue after executing the following sample code using the latest version: Aspose.Cells
for .NET v8.6.1.2
. Pivot table loses header’s order after working with input file.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-44063 - Pivot table loses header’s order after working with input file

I have also attached the output excel file generated by it for a reference.

C#
string filePath = @“D:\Downloads\WrongPivotHeaderOrder.xlsx”;

Workbook workbook = new Workbook(filePath);

Worksheet worksheet = workbook.Worksheets[0];

PivotTable pt = worksheet.PivotTables[0];

pt.RefreshData();
pt.CalculateData();

workbook.Save(“output.xlsx”);

Hi Aspose Team,


Any update?

Thanks!

Hi,

Thanks for your posting and using Aspose.Cells.

We are afraid, there is no update for you regarding this issue at this moment. However we have logged your comment in our database against this issue and requested the product team to provide some fix or ETA for this issue. Once there is some news for you, we will update you asap.

Hi,

Any update on the issue? Our users escalate this issue as being very critical for proper reporting, and we cannot find a reasonable workaround on our side. The fact that we cannot get it fixed for so long rises additional concerns.

What’s the status of it with the Aspose’s dev team today? Is ETA available?

Thanks a lot,
Dmitry

This issue is very critical for our reporting scenario. We have huge reports that require specific order in pivots.

Could you please provide any ETA?
Thx

Hi,

Thanks for using Aspose.Cells.

We are afraid, there is no update for you regarding this issue at this moment, the issue is still unresolved. However, we have logged your comment in our database against this issue for product team consideration and requested them to provide some fix or ETA for this issue. Once, there is some fix or news for you, we will let you know asap.

I found a similar issue logged here:


Pivot table: date is not shown in sorted order

And it says that the issue was resolved in 7.5.2. Does it mean that the current behavior is a regression?

Hi,

Thanks for your good question and using Aspose.Cells.

If some older version like 7.5.2 is working fine with your excel file and the latest one is not doing good, then it will be considered as regression. But if the older version is also not working fine with your particular excel file, then it will not be considered as regression but it will be treated as a new issue. Because all excel files which look similar apparently are not similar internally. Although we try to fix the issues as general as possible but still issues specific to new excel files remain.

Hi,


We are working over your issue and we hope, it will be fixed by December 31, 2015.

Once the fix is available for public use, we will share it with you here.

Thank you.

Thanks, Amjad, that’s great to hear :slight_smile:

Hi,


This is to update you that your issue is more complicated than it looks. Well, before fixing this issue, we must support manual sorting options of PivotField first, so we can’t deliver the fix version on estimated (promised) date i.e., December 31, 2015, we will try to figure out your issue soon though.

Once we have an update on it, we will let you know here.

We are sorry for any inconvenience caused!

Hi,

Thanks for using Aspose.Cells.

It is to inform you that your issue should be fixed in about January 29, 2016.

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.7.0.1 and let us know your feedback.

Thanks, this version fixes our issue.

Hi,


Thanks for your feedback.

Good to know that your issue is sorted out now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.

Thank you.

The issues you have found earlier (filed as CELLSNET-44063) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.