Free Support Forum - aspose.com

CRITICAL ISSUE : Rendering an excel range as HTML gives ####.. in one of the columns

THIS IS A CRITICAL PRODUCTION ISSUE REPORTED BY ONE OF OUR CUSTOMER.


Hi,

I am using Aspose cells 8.4.2.
In context of the attached excel file, I am copying the range A1:J26 to a new sheet & then saving the new workbook as HTML.
The issue is that the HTML has ##### in the cells of column ‘IssueCol’.
I have observed that the range has been copied correctly to the new worksheet.
But when this worksheet is saved as HTML, the data in column ‘IssueCol’ has ######.
Can you please address this issue urgently?

Attachments include the source excel file & sample HTML output.
Thanks,
Jaspreet

Hi Jaspreet,


Thank you for contacting Aspose support.

I have evaluated your presented scenario while using the latest version of Aspose.Cells for Java 8.4.2.2 and the following piece of code. The resultant HTML does contain the # string at the end of values in the column G. Please confirm your code so we could log this incident in our bug tracking system for further investigation.

Java

Workbook workbook = new Workbook(“D:/Book1_HashIntable+snippet.xlsx”);
Range sourceRange = workbook.getWorksheets().get(0).getCells().createRange(“A1:J27”);
Workbook newWorkbook = new Workbook(FileFormatType.XLSX);

WorksheetCollection targetWsc = newWorkbook.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();
//Copy everything
options.setPasteType(PasteType.ALL);
targetRange.copy(sourceRange, options);

newWorkbook.save(“D:/new.xlsx”, SaveFormat.XLSX);
newWorkbook.save(“D:/new.html”, SaveFormat.HTML);

Hi again,


This is to inform you that I have logged an investigative ticket CELLSJAVA-41355 based on my observations as discussed in my previous response. As soon as you share your code snippet, we will reevaluate the scenario and provided it to the product team.

Hi,


Here is the code snippet of how we copy the range to new workbook:

private static Workbook createWorkBookUsingPasteOptions(final Range sourceRange) throws Exception {
Workbook newWorkbook = new Workbook(FileFormatType.XLSX);
WorksheetCollection targetWsc = newWorkbook.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();
//Fixed bugs : #205478 & #205656.
//Used COLUMN_WIDTHS option as suggested at following links
//http://www.aspose.com/community/forums/619075/cell-width-is-not-being-honoured-in-html-output/showthread.aspx#619075
//http://www.aspose.com/community/forums/thread/619375/extra-columns-in-html-output-of-a-range-table.aspx
//Copy column widths
options.setPasteType(PasteType.COLUMN_WIDTHS);
targetRange.copy(sourceRange, options);
//Copy everything else
options.setPasteType(PasteType.ALL);
targetRange.copy(sourceRange, options);
return newWorkbook;
}

& then save the workbook to HTML using :
book.save(htmlFile.getAbsolutePath(), SaveFormat.HTML);


In addition, I have an observation that if we save the range to html using MS Excel, the IssueCol shows appropriate values & not #####…
Attached the HTML output of range using MS Excel.

Thanks,
Jaspreet

Hi Jaspreet,


Thank you for the code snippet. The code I have provided with the ticket is almost same as of yours except one difference that my code is copying the range once. This is because with latest version, the option PasteType.ALL pastes everything including the column widths. Anyway, I have quickly tested your code as well and it produces the same result.

Regarding the output of the Excel application for same scenario, it is correct as # string is not getting appended to the cell values.

Hi,


Being a customer production issue, there is an urgency to provide the fix as soon as possible to the customer. It would be highly appreciated if this issue is addressed on priority & some patch/minor release for this issue is provided.

For some Aspose cells issues, we have recently moved to Aspose cells 8.4.2.5. So, can there be some minor release for this issue as well?

Also, we have to get back to the customer with solution dates, so can you please share with us with the tentative dates for this fix.

Thanks,
Jaspreet

Hi Jaspreet,


I am afraid, the ticket attached to this thread isn’t resolved yet, nor we have received any updates regarding the issue. We have requested the concerned person from the product team to provide the insight of the problem and most preferably an ETA for the fix. As soon as we receive updates, we will post here for your kind reference. Moreover, as soon as the issue is resolved, we will provide he fix with next maintenance release.
Hi,

Did you get an ETA for the fix from the concerned person of the product team?

As stated earlier also, we need to update the customer based on this.

Thanks,
Jaspreet

Hi,

Thanks for using Aspose.Cells.

This issue should be fixed in about June 26, 2015.

Hi Jaspreet,


This is to inform you that the ticket logged earlier as CELLSJAVA-41355 has been resolved. We will shortly provide the fix with the upcoming major release of Aspose.Cells for Java 8.5.0 after performing QA and incorporating other enhancements.

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


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