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

Free Support Forum - aspose.com

Inserting formula corrupts sheet name

Hi,


Using Aspose Cells for Java, version 17.1.10.

Sample code:
<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>Workbook one = new Workbook();
WorksheetCollection worksheets = one.getWorksheets();
Worksheet worksheet = worksheets.get(0);
Cell cell = worksheet.getCells().get(1, 1);
cell.setFormula("=’[na.xlsx]" + worksheet.getName() + “’!” + CellsHelper.cellIndexToName(1, 1));
worksheets.add();
worksheet = worksheets.get(1);
cell = worksheet.getCells().get(1, 1);
cell.setFormula("=’[na.xlsx]" + worksheet.getName() + “’!” + CellsHelper.cellIndexToName(1, 1));
System.out.println(cell.getFormula());
one.save(“one.xlsx”);
Please note that “na.xlsx” workbook is not present on the file system.
The first sheet in the resulting workbook is fine: the formula inserted is "=‘C:\dev[na.xlsx]Sheet1’!B2"

However, in the second sheet, Aspose Cells corrupts the inserted formula (as can be seen by the System.out.println() call): the sheet name is uppercased.
Instead of inserting what the code asks for, Aspose Cells inserts the formula “=‘C:\dev[na.xlsx]SHEET2’!B2”.

Kind regards,
Taras

Hi,


Thanks for your posting and using Aspose.Cells.

We were able to observe this issue as per your code and description. 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

  • CELLSJAVA-42193 - Sheet name gets Upper-cased on inserting formula

Hi,


This is to inform you that we have fixed your issue (logged earlier as “CELLSJAVA-42193”) now. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

Thank you.

Hi Amjad,


That is nice to hear. We are looking forward to trying the upcoming version when it becomes available.

However, since we’ve run into a number of similar bugs over the last year, I am really wondering why there is code somewhere in Aspose that is forcing sheetnames in formulas to uppercase.

Can you explain why Aspose is trying to re-write the formula in the first place?

Thanks in advance,
Taras

Hi,

TarasTielkes:
........
However, since we've run into a number of similar bugs over the last year, I am really wondering why there is code somewhere in Aspose that is forcing sheetnames in formulas to uppercase.

Can you explain why Aspose is trying to re-write the formula in the first place?


I am in coordination with the product team to share your concerns. Hopefully, we could give you details about the root cause of this issue. We will get back to you soon.

Thank you.

Hi,


1) The sheet name is case-insensitive in MS Excel, so the formula with upper-cased sheets’ name is correct too. In the older version(s), when inserting the second formula, we find there is a same external link, then we compare the existing sheet names array with Upper-cased Sheet name(s), if the sheet does not exist, we just simply added the Upper-cased Sheet name.

2) Aspose.Cells converts the string formula to binary formula in order to improve performance of adding/deleting/copying workbook/worksheets/ranges.

Thank you.

The issues you have found earlier (filed as CELLSJAVA-42193) have been fixed in Aspose.Cells for Java 17.2.0.


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