Aspose.Cells: XLSX to XLSB conversion produces corrupted file if there is a pivot table

Hi,
Our product (MyOffice Spreadsheets Editor) uses Apsose.Cells 23.3 for conversion from XLSX to XLSB.
When XSLX (produced by MyOffice SE) contains pivot table, conversion produces corrupted XLSB file which can not be opened by MS Excel (Excel crashes), though original XLSX can be opened by MS Excel without any problems.
The conversion problem can be reproduced by using web conversion via Convert XLSX to XLSB Online for Free - attaching a simple file example for reproduction:
simple_pivot_table.zip (15,2 КБ)

Could you please advice what part of pivot table metadata in XLSX-file can cause such a problem?

@oleg.ryskov
By using sample files for testing on the latest version v24.3, we were able to reproduce the issue. Found that the result file crashes when converting xlsx to xlsb.

The sample code as follows:

Workbook wb = new Workbook(filePath + "simple_pivot_table_mo.xlsx");
wb.Save(filePath + "out_net.xlsb");

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-55447

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@oleg.ryskov,

This is to inform you that your issue (ticket logged as “CELLSNET-55447”) has been resolved. The fix/enhancement will be included in our upcoming release (Aspose.Cells v24.4) that we plan to release next week. You will be notified when the next version is released.

Thanks a lot. It was really fast.
We’ll check that the issue gone on the upcoming version of Aspose.Cells and publish the feedback here.

Best regards, Oleg

@oleg.ryskov,

You are welcome.

We will keep you posted with updates on it.
Stay tuned!

The issues you have found earlier (filed as CELLSNET-55447) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi

Hi,

I’ve checked the issue on Aspose.Cells 24.4, on file with simple pivot table it’s not reproducible, but on original file from our QA (more complicated) it’s still reproduced.

Attaching the file with more complicted pivot table.

Could you please help and advise what part of pivot table metadata in XLSX-file can cause such a problem?

bug_sample.zip (284,9 КБ)

@oleg.ryskov,

I tested your scenario/case using the following sample code with your template XLSX file and it works fine. The output XLSB file is fine tuned and I can open it into MS Excel 2019 without any error or warning.
e.g.
Sample code:

Workbook wb = new Workbook("g:\\test2\\Diverse_content_MO.xlsx");
wb.Save("g:\\test2\\out1.xlsb"); 

out1.zip (128.5 KB)

Do you find any warning or error when processing the code in your debug window? What is your MS Office/Excel version? Could you please share some screenshots to highlight the issue?

Hi,

Thank you for the fast response. Yes, looks like that this time it’s a different issue.
I’m using MS Excel 2016 for checking compability, and it crashes while opening the attached XLSB-file at previous post.

@oleg.ryskov,

Could you please share screenshots while crashing in MS Excel 2016. Also, please try opening it into newer/higher versions (e.g., MS Excel 2019, 2021, 365) and how it goes?

@amjad.sahi

OK, will check on higher versions of MS Excel and provide video of crash (but it shows very little) - will get back tomorrow with these.

@oleg.ryskov,

Alright, please take your time to provide the required detail and resource files. Also, if it works with newer versions of MS Excel, then you should upgrade your MS Excel version.

Hi,

We can confirm that the problem is still reproducible on the MS Excel 2016 while opening the attached Diverse_content_MO_24.4.xlsb, which is created locally using Aspose.Cells 24.4 from attached Diverse_content_MO.xlsx file, created by MyOffice Spreadsheet editor.

The problem is not reproducible on the newer versions of MS Excel (2019, 2021, and current from Microsoft 365 subscription). So it can be some MS Excel 2016 issue, which was fixed in the subsequent versions.

Nevertheless our clients and QA still using MS Excel 2016 as one of actual versions, and they can’t easily migrate to newer versions.

Do you still actively support MS Excel 2016 as a XLSB-file destination?

reproduce_me_pack.zip (284,9 КБ)

@oleg.ryskov,

Thanks for providing further details and sample files.

Generally, we follow newer versions of MS Excel standards as most of our users will want to use them in their diverse scenarios. There are some differences in behaviors and other problems for different file formats with different MS Excel versions. So, if we only follow older versions of MS Excel when parsing or generating Excel files, newer versions of MS Excel might contradict and may have compatibility or other issues. We suggest that you kindly upgrade to newer MS Excel versions to get future fixes of Aspose.Cells in accordance with them.

@oleg.ryskov
We will further investigate the issue of crashing when saving file as xlsb and opening the result file in Excel 2016.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-55612

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@oleg.ryskov
There are some issues in generated xlsx file. It seems that MyOffice SE does not support local formatting (the value of C2 is " 0.85 ₽ ", not " $0,85 " ),so the names of pivot field are not same as data source.
Please refreshing pivottables before saving file as the following:

  Workbook workbook = new Workbook(dir + "Diverse_content_MO.xlsx");
  workbook.Worksheets.RefreshPivotTables();

Then , check whether MS Excel 2016 can open it.
BTW, please create the pivot tables based on correct source data. There should be a header row in the worksheet “Data” and the data source of pivot table should contains a header row.

And please try to creating pivottables with Aspose.Cells too.