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

Free Support Forum - aspose.com

Workbook gets corrupted when removing a sheet which has a pivot table

hi, my application uses template files that have several sheets with pre-configured pivot tables+charts which link to tables. if i remove a sheet that has a table which is linked to a pivot table and the sheet with the pivot table i get a warning when opening in excel because the PivotCache is still referenced in the XML even though the sheets/tables are gone. i have attached a sample template and code to reproduce.


Workbook wb = new Workbook(templatePath);
wb.Worksheets.RemoveAt(0);
wb.Worksheets.RemoveAt(0);
wb.Save(
templatePath + “.out.xlsx”);
Copy charts from workbook to another
Problem with custom formatting of text values when exporting to PDF
Error in Aspose.Cells.dll while using WorkBook.Copy()
Corruption when adding fields to Pivot Table
SheetRender not wrapping text properly and text with imbedded colors overlapping in image
Tables as DataSource for PivotTable broken using Designer
Unable to convert some XLSX files to TIFF
Calculate number of words
Shapes.AddCopy throws Index was out of range
Arithmetic operation resulted in an overflow. Arithmetic operation resulted in an overflow. Arithmetic operation resulted in an overflow
Text not fully visible in merged Cell
Problem with the Generation of Excel with 1 Million Rows using Aspose.Cells (Evaluation)
Corrupted cell colouring after worksheet copying
Problem with custom formatting of text values when exporting to PDF
Upgrade fromversion 5.1 to 7.0.3
Problem in Area Chart during run time
SheetRender not wrapping text properly and text with imbedded colors overlapping in image
Aspose.Cells Chart Gradient effect problem
Multiple issues while upgrading from v5.2.1.0 to v7.0.3.0 - Few Issues and Question
Problem in Are Chart during run time
Using COM interop. Excel SUMIFS Function Issue
Bunch of issues when changed constructors
Request for improved exception handling in Aspose.Total
Excel to PDF - Set number formatting for grouping and decimal separator by setting workbook region and locale
Charts.ToImage quality
Copy charts from workbook to another
Problem with calculated cells when saving in pdf format
How the format of the cell
Charts.ToImage quality
Multiple issues while upgrading from v5.2.1.0 to v7.0.3.0 - Few Issues and Question
Error in Aspose.Cells.dll while using WorkBook.Copy()
Could not update Combobox in xlsm file
Shapes.AddCopy throws Index was out of range

Hi,

Thanks for your reporting and using Aspose.Cells for .NET.

We were able to replicate the problem using the latest version. We have logged this issue in our database.

Development team will look into this issue and fix the problems and once the issue is fixed or we have some other update relating to it, we will let you know asap.

This issue has been logged as CELLSNET-40469.

Hi,

We have fixed. this issue. Please download and try this fix: Aspose.Cells for .NET v7.1.2.1

hi, thanks for the quick turnaround. while this fix does seem to work for the sample template i attached in the first post, it now causes a causes a crash in the WorksheetCollection.RemoveAt(Int32 index) method when running on a more complicated template. please retry my original code on the attached template.



exception:
Collection was modified; enumeration operation may not execute.
at System.Collections.Hashtable.HashtableEnumerator.MoveNext()
at Aspose.Cells.WorksheetCollection.RemoveAt(Int32 index)

Hi,

Thanks for providing us the new template file.

Yes, I got the exception (you mentioned) using your newly attached file: Lease_Pivot_Template.xlsx (Workbook gets corrupted when removing a sheet which has a pivot table).
I have reopened your issue “CELLSNET-40469” again and we will soon look into it.

Thank you.

Any update on this issue?

Hi,


I have asked the relevant developer working over your case to update on it. Once we have any update, we will let you know immediately here.

Thank you.

Hi,

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

Currently, I am no longer able to add PivotFields to the Data area without the following CellsException being thrown: "You could not add data field to the data fields"


I am using the attached report with the code snippet below.

PivotTable pt = m_currentWorkbook.Worksheets[1].PivotTables[0];
for (int year = 2009; year <= 2012; year++)
{
PivotField field = pt.BaseFields[year.ToString()];
if (field != null)
pt.AddFieldToArea(PivotFieldType.Data, field);
}

Hi,

Thanks for your feedback.

I was able to reproduce the problem using the latest version:
Aspose.Cells
for .NET v7.1.2.2

with your code.

We have logged your comment in our database against the issue id: CELLSNET-40469

We will look into it and fix the problems.

Hi,

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

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.