Save to html: "wrap text" ignored

Hi,

Using Aspose Cells for Java, version 17.12.4.
Input and output files attached. Sample code:

Workbook workbook = new Workbook("input.xlsx");
Worksheet sheet = workbook.getWorksheets().get("Entry points");
workbook.getWorksheets().setActiveSheetIndex(sheet.getIndex());

HtmlSaveOptions options = new HtmlSaveOptions();
options.setExportActiveWorksheetOnly(true);
options.setExportFrameScriptsAndProperties(false);
options.setExportDocumentProperties(false);
options.setExportWorkbookProperties(false);
options.setExportWorksheetProperties(false);

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

In the source workbook, for the sheet we are saving, note that the column headers cells (C3:T3) have “Wrap Text” enabled.

For example, if you look in the result HTML file produced by Aspose Cells for cell C3, you’ll see:

<td class='x4855'>Quarterly&nbsp;Solvency&nbsp;II&nbsp;reporting&nbsp;Solo</td>

Aspose Cells seems to have replaced all space characters by non-breaking spaces (&nbsp;). In addition, looking up the declaration of style “x4854” gives:

.x4854
{
	...
    vertical-align:middle;
    white-space:normal;word-wrap:break-word;
    background:#D9D9D9;
	...
}

Here “word-wrap:break-word” has been added. As a result, in the generated HTML, the wrapping is effectively by character, instead of by word.

The end result is that the text becomes harder to read. Since the HTML produced by Excel does have proper word-wrap behavior, I assume this is a bug.html-word-wrap-17.12.4.zip (1.4 MB)

Kind regards,
Taras

@TarasTielkes

Thanks for using Aspose APIs,

We were able to observe the issue as per your description and logged it in our database for investigation and for a fix. Once, the issue is resolved or we have some other news for you, we will let you know asap.

This issue has been logged as

  • CELLSJAVA-42495 - Excel to Html - Wrap text is ignored

@TarasTielkes

Thanks for using Aspose APIs.

This is to inform you that we have fixed your issue CELLSJAVA-42495 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

@TarasTielkes

Please download and try the following fix and let us know your feedback.

Hi @shakeel.faiz,

Aspose Cells for Java 17.12.7 seems to have introduced a regression.
We can no longer open the attached XLSX workbook.

The exception thrown is:

Exception in thread "main" java.lang.NullPointerException
	at com.aspose.cells.zall.a(Unknown Source)
	at com.aspose.cells.zamn.a(Unknown Source)
	at com.aspose.cells.zamn.b(Unknown Source)
	at com.aspose.cells.zamn.v(Unknown Source)
	at com.aspose.cells.zamn.c(Unknown Source)
	at com.aspose.cells.zamm.a(Unknown Source)
	at com.aspose.cells.Workbook.a(Unknown Source)
	at com.aspose.cells.Workbook.a(Unknown Source)
	at com.aspose.cells.Workbook.<init>(Unknown Source)
	at <our code>

The sample code to reproduce is simply:

Workbook workbook = new Workbook("input.xlsx");

Kind regards,
Taras

input.zip (1.4 MB)

@TarasTielkes

Thanks for using Aspose APIs.

We were able to observe this regression. It does not occur in older version like 17.12 and occurs in the 17.12.7.

We have logged it in our database for product team investigation and for a fix. Once, the issue is resolved or we have some other news for you, we will let you know asap.

This issue has been logged as

  • CELLSJAVA-42500 - NullPointerException occurs while loading the Excel file

Java

Workbook workbook = new Workbook(dirPath + "input.xlsx");

Exception:

Aspose.Cells for Java v17.12.7
Exception in thread "main" java.lang.NullPointerException
	at com.aspose.cells.zall.a(Unknown Source)
	at com.aspose.cells.zamn.a(Unknown Source)
	at com.aspose.cells.zamn.b(Unknown Source)
	at com.aspose.cells.zamn.v(Unknown Source)
	at com.aspose.cells.zamn.c(Unknown Source)
	at com.aspose.cells.zamm.a(Unknown Source)
	at com.aspose.cells.Workbook.a(Unknown Source)
	at com.aspose.cells.Workbook.a(Unknown Source)
	at com.aspose.cells.Workbook.<init>(Unknown Source)
	at ClsAsposeCells.f1(ClsAsposeCells.java:29)
	at ClsAsposeCells.main(ClsAsposeCells.java:12)

@TarasTielkes

Please download 17.12.7 once again (please discard the previous one) from the following link and it will work fine as we have tested it.

@shakeel.faiz
Both issues (original problem and NPE) seem to be resolved in latest build.

@TarasTielkes

It is good to know that your issue is resolved with the latest fix. Let us know if you encounter any other issue, we will be glad to look into it and help you further.

The issues you have found earlier (filed as CELLSJAVA-42495;CELLSJAVA-42500) have been fixed in this Aspose.Cells for Java 18.1 update.

Please also check the following document/blog for your reference:

Hello @Ajmal Does this issue is fixed in aspose .cells for .net in v19.12? Because i am also encountered by this issue in which I applied word wrap and text is seen to be break

@shalinigupta1794,

Please note, the issue logged as “CELLSJAVA-42495” in this thread, is template (Excel file) specific so your issue might be different. Moreover, we recommend you to kindly try using latest version of the APIs (Aspose.Cells for .NET v23.8) for your scenario/case.

Additionally, we already replied you in your other thread, so kindly check and follow up in your thread.

Using the latest version the HTML created from excel file gets distorted so thats why I used the stable version 19.12

@shalinigupta1794,
Thank you for your feedback. We will further enhance the conversion results. We apologize for any inconvenience caused. If you have any questions, please feel free to contact us.

@shalinigupta1794,
I have tried the latest version 23.8 and the result looks well output_23.8.zip (28.9 KB).
Can you explain what the problems in the latest verson? Please share your template file, we will check it soon.

@Eric.wang,

For your information, the user is talking about the issue shared in other thread which he posted. We already reproduced the issue and logged a ticket with an id “CELLSNET-53972” for it.