I am using Aspose Cells 8.3.0 and generating html output of selected range. It gives me extra rows in the html output. The range B6:C12 has 7 rows but it gives me 8 rows.
If I create the html output of the same range from the Excel, it runs fine and gives correct number of rows.
For your reference I have also attached the source excel file, html generated using Aspose and html generated from within the Excel.
It seems problem occurs when Data Tables are used.
Kindly, treat this is on urgent basis as the issue is being faced by the customer in the production environment. Its not matter of only extra rows being inserted but that extra row also contain incorrect colspan which spoils the complete structure of the data.
Following is code snippet being used:
Workbook workbook = new Workbook("C:/temp/rows_mismatch.xlsx");
com.aspose.cells.Worksheet selectedWorksheet = workbook.getWorksheets().get("Sheet1");
//Create Range
Range sourceRange = selectedWorksheet.getCells().createRange("B6:C12");
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();
options.setPasteType(PasteType.ALL);
targetRange.copy(sourceRange, options);
File htmlFile = new File("C:/temp/RowsMismatch-Aspose-Generated.htm");
targetWorkbook.save(htmlFile.getAbsolutePath(), SaveFormat.HTML);