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

Free Support Forum - aspose.com

Formulas in HTML

A change in behavior was introduced between Aspose Cells for Java versions 21.10 and 21.11.

Sample code:

Workbook workbook = new Workbook("source.xlsx");
HtmlSaveOptions saveOptions = new HtmlSaveOptions(SaveFormat.HTML);
saveOptions.setExportActiveWorksheetOnly(true);
workbook.save("result.html", saveOptions);

In the HTML output from 21.10, the formula is present:

<td height='19' x:fmla="=A1+A2*A3" style='text-align:right;height:14.5pt;'>7</td>

In the HTML output from 21.11, the formula is gone:

<td height='19' align='right' x:num="7.0" style='height:14.5pt;'>7</td>

Strangely, the release notes for 21.11 do not seem to mention anything relevant.

files.zip (9.9 KB)

Kind regards,
Taras

@TarasTielkes,

Please notice, I am able to reproduce the issue as you mentioned by using your template file.
In the output HTML using 22.5, the formula reference is missing. I have logged a ticket with an id “CELLSJAVA-44670” for your issue. We need to investigate if this is deliberately changed behavior or something else. We will look into it soon.

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

@TarasTielkes,

This is to inform you that your issue has been resolved. The fix will be included in the next release (Aspose.Cells for Java v22.7) which is scheduled in the second week of July 2022. You will also be notified when the next version is released.

Thanks, @Amjad_Sahi,

Is there perhaps already a bugfix (22.6.x) build available for us to try out?

Kind regards,
Taras

@TarasTielkes,

No, in normal support forums here, we do not post/provide fixes for the users now.
If you need a quick fix, you may avail paid support to get the hotfix urgently. We provide interim fixes or hotfixes for paid support clients only.

Hi @Amjad_Sahi,

That must have been a recent change in policy then.
There are two sides to that coin: while you might persuade more users to go for paid support, you will also lose some regression feedback from non-paid-support users informing you about regressions in “interim” builds.

Kind regards,
Taras

@TarasTielkes,

Please note, previously Aspose.Cells team was not following the policy as we were providing fixes regularly in each week. Now the policy has been implemented across the board, so we have to follow it. Please don’t take us wrong. We would love to fix issues and provide fixes in quick time. I guess, only couple of weeks are left to publish new release, so you may get it in the next month.

The issues you have found earlier (filed as CELLSJAVA-44670) have been fixed in this update. This message was posted using Bugs notification tool by Peyton.Xu

Hi @Amjad_Sahi,

Unfortunately, this is still not working in 22.7.

Sample code:

Workbook workbook = new Workbook("input.xlsx");
HtmlSaveOptions saveOptions = new HtmlSaveOptions(SaveFormat.HTML);
saveOptions.setExportActiveWorksheetOnly(true);
saveOptions.setExportImagesAsBase64(true);
workbook.save("output.html", saveOptions);

files.zip (79.8 KB)

As you can see from the attached sample files, the output from Aspose Cells for Java, version 21.10, contains 4 formulas, on lines 2785, 2847, 2909 and 2971.

In contrast, the output from Aspose Cells for Java, version 22.7 does not include any formulas at all.

Kind regards,
Taras

@TarasTielkes,

We will look into your issue soon.

@TarasTielkes

If not all the sheets are exported to html,formulas may link to other sheets which are not exported. e.g. the formulas in your source file: =S.26.06.01!C26, =S.25.01.01_LAC_DT!C25. So the formulas are meaningless even they are exported into html. So the formuals are not exported in this case.

@Peyton.Xu,

Note that in Aspose Cells for Java version 21.10, things are working as expected: formulas, including those that refer to other sheets are exported.

As for the formulas being “meaningless”, I would not say so.
In our software, we are visualizing one sheet of a workbook at a time in HTML format, so it makes perfect sense to only export one specific sheet. I don’t think the contents of the formula, and whether it refers to other sheet(s) or not, should not influence whether they are included in the export of the current sheet.

Kind regards,
Taras

@TarasTielkes

Thank for your details.
It make us take the formulas in output html carefully. We will output formulas to html when HtmlSaveOptions.ExportFormula is true(default value is true). If the formulas are not expected to output to html, set HtmlSaveOptions.ExportFormula to false.

A ticket CELLSJAVA-44777 is logged for it. If we have any progress, we will let you know.

Hi @Peyton.Xu,

Are you planning to include the fix in Aspose Cells for Java 22.8?

Thanks,
Taras

@TarasTielkes,

The issue (logged earlier as “CELLSJAVA-44777”) has been resolved. The fix will be included in the next official release archive (Aspose.Cells v22.8) scheduled for the second week of August 2022. You will also be notified when the next version is released.

Hi @Amjad_Sahi,

Thank you for the confirmation.

It is a pity that you have decided to not make bugfix builds available anymore, otherwise we could have performed our regression test suite before the 22.8 release.

Kind regards,
Taras

@TarasTielkes,

Yes, in normal support forums here, we do not post/provide fixes for the users now. Previously, Aspose.Cells team was not following this policy as we were providing fixes regularly in each week. But, now the policy has been implemented across the board, so we have to follow it.

If you need a quick fix, you may avail paid support to get the hotfix urgently. We provide interim fixes or hotfixes for paid support clients only.

Hi @Amjad_Sahi,

I understand that there is a new policy, but let me comment a bit from our perspective on it.
We do not really require the bugfix builds for production usage, as we prefer to use the regular releases, assuming that those get a more thorough regression testing exercise on your side.

However, it often happens that the initial fix for a reported issue does not fully work. Typically, we submit a minimal testcase, extracted from customer data. The reason we do this is that customer data is typically confidential. In addition, I expect that the developers on your side prefer a small testcase to a more complex one.

In the past, with bugfix builds being available, we could re-test the fix on our side, in addition to running our own regression suite with various workbooks. This seemed like a win-win situation, as you get additional testing for free, while we get more confidence that the issues reported are fully addressed.

In the new policy, it seems like we would need to pay additional support costs for work that we would typically do, which benefits you, as well as all other users of Aspose Cells. Since we have a Site OEM license, it is hard do understand the cost/benefit ratio from our perspective.

Anyway, this is just an opinion from our perspective, I hope that it might be useful.

Kind regards,
Taras

@TarasTielkes,

We understand your concerns but we got to follow the policy. To give you more information on it, this is not a new policy rather an older policy but only Aspose.Cells team was not following it which was an exceptional case. We used to post fixes in each week against users scenarios or issues. Now the policy has been implemented across the board and it is compulsory to be followed by all.

Please don’t take us wrong as we won’t press you to avail paid support. One option to cope with your situation is, you may gather more diverse files for the test case(s) and provide us. We will add/log those files and test cases against your existing ticket(s). This way, we could conduct regression testing to cover your complete scenario using your different files and exercise test cases on your behalf using the fixed version(s). And, at the end before including the final fix to the new releases, we can make sure all the test cases should have been passed with all your files/resource data.

The issues you have found earlier (filed as CELLSJAVA-44777) have been fixed in this update. This message was posted using Bugs notification tool by Peyton.Xu