Inconsistent HTML output for charts

Hi,

Using Aspose Cells for Java, version 25.2.

Sample code:

Workbook workbook = new Workbook("input.xlsx");
WorksheetCollection worksheets = workbook.getWorksheets();
workbook.calculateFormula();

Worksheet worksheet = worksheets.get("Dashboard");
worksheets.setActiveSheetIndex(worksheet.getIndex());
HtmlSaveOptions saveOptions = new HtmlSaveOptions(SaveFormat.HTML);
saveOptions.setExportActiveWorksheetOnly(true);
saveOptions.setEncoding(Encoding.getUTF8());
saveOptions.setExportImagesAsBase64(true);

workbook.save("output.html", saveOptions);

The attached zip file contains the Excel input, the HTML result, and a picture showing a comparison of the Excel and HTML rendering.

A number of inconsistencies can be observed:

  • the bar chart shows different values than Excel
  • the line over the bar chart is impossible to see, since Aspose seems to be using the wrong colors for that bar chart
  • in general, there seem to be a number of color inconsistencies. For example, compare the rendering of the world map
  • to the right of the “Top 10” section, there is an unexpected vertical grey line
  • the Excel rendering shows a “stopwatch”, while the Aspose rendering shows a “green checkmark”

Kind regards,
Taras
repro.zip (1.4 MB)

@TarasTielkes,

Thanks for the template Excel file, screenshot and output HTML file.

After initial testing, I am able to reproduce the problems as you described by using your template Excel file. I found your mentioned discrepancies/differences when exporting the Excel file to HTML.

We require thorough evaluation of the issue. 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): CELLSJAVA-46271

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.

@TarasTielkes
According to our developers’ research, if you want to achieve the expected effect, you need to call the following code:

//workbook.CalculateFormula();
workbook.Worksheets["Dashboard"].Shapes.UpdateSelectedValue();

If you must call “workbook.CalculateFormula();”, you need to make sure that at least one of the cells “!P16:P25” of the worksheet “02.02 Dashboard Calculation” (which is a hidden worksheet) is true.

1 Like

Hi @TarasTielkes
For the issue of chart rendering inconsistency with excel, we have made the corresponding corrections. The current output result is as follows, and it will take in version 25.4.
250318.png (31.2 KB)

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

Hi @leoluo,

The output in 25.4 is closer to what Excel shows, thank you for the improvement.

I have attached another comparison, using the same reproduction code in the original post, which shows another unexpected cell border.

Kind regards,
Taras
repro.zip (1.5 MB)

@TarasTielkes,

Thanks for the template Excel file, output HTML and screenshot.

After initial testing, I am able to reproduce the issue as you mentioned by using your original sample code and template Excel file. I found unexpected cell border line appeared (as per your screenshot) in Excel to HTML conversion.

We require thorough evaluation of the issue. 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): CELLSJAVA-46358

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.

@TarasTielkes ,

We are pleased to inform you that your issue (CELLSJAVA-46358) has been resolved. The fix will be included in an upcoming release (Aspose.Cells v25.5) that we plan to release in the first half of May 2025. You will be notified when the next version is released.
Attached is the result after fix for your reference: output.zip (149.5 KB)