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

Free Support Forum - aspose.com

Columns mismatch in HTML output

I am generating html output of selected range/table. It gives me extra column in the html. The range A5:E10 has 5 columns but it gives me 6 columns.

If I create the html output of the same range from the Excel, it runs fine and gives correct number of columns.
For your reference I have also attached the source excel file, html generated using Aspose and html generated from within the Excel.

Following is code snippet being used:
Workbook workbook = new Workbook(“C:/temp/columns_mismatch.xlsx”);
com.aspose.cells.Worksheet selectedWorksheet = workbook.getWorksheets().get(“Sheet1”);

//Create Range
Range sourceRange = selectedWorksheet.getCells().createRange(“A5:E10”);

Workbook targetWorkbook = new Workbook(FileFormatType.XLSX);
WorksheetCollection targetWsc = targetWorkbook.getWorksheets();
com.aspose.cells.Worksheet targetWs = (com.aspose.cells.Worksheet)targetWsc.get(0);
Range targetRange = targetWs.getCells().createRange(0, 0, sourceRange.getRowCount(), sourceRange.getColumnCount());

PasteOptions options = new PasteOptions();

targetRange.copy(sourceRange, options);

File htmlFile = new File(“C:/temp/AposeGenerated.htm”);
targetWorkbook.save(htmlFile.getAbsolutePath(), SaveFormat.HTML);

Hi Neeraj,

Thank you for contacting Aspose support.

Unfortunately, we are unable to replicate the presented problem on our end while using the latest version of Aspose.Cells for Java The resultant file (as attached) shows the correct number of columns in HTML format as they are in the spreadsheet. We would request you to please give the latest version a try on your end.

Thanks for the response.

I have tried using Aspose.Cells for Java as suggested by you.

Unfortunately, the issue is still reproducible at my end. Extra column still appears in the html.

Here is the snippet of the generated html source with the highlighted extra column that still appears:


Class Cricket Football Basketball total
1 12 10 8 31

Hi Neeraj,

Thanks for highlighting the HTML markup explaining this issue and using Aspose.Cells.

We were able to observe this issue after executing your code with your source file using the latest version: Aspose.Cells
for Java v8.1.2.5

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


Thanks for using Aspose.Cells for Java.

Please download and try this fix: Aspose.Cells for Java v8.2.0.2 and let us know your feedback.

The issues you have found earlier (filed as CELLSJAVA-40954) have been fixed in this update.

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