Save to html: "wrap text" ignored


#1

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


#2

@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

#3

@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.


#4

@TarasTielkes

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


#5

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)


#6

@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)

#7

@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.


#8

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


#9

@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.


#10

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: