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

Free Support Forum - aspose.com

Text color of the text in Header is lost in Chart's HTML

Hello,


I am using Aspose.Cells v8.6.2.4

I am converting the attached excel file (refer - test.xlsx) to html. In table - Table1 in worksheet - Sheet1, header row has black background and white text-color. In the html output, the text color is black and it makes the text invisible (refer - “text color issue.png”).

workbook.save(“D:\temp\out.html”, SaveFormat.HTML);

For Header Row’s html, refer - "header row’s html.png"


I have attached the excel file and screenshots.

Can you please look into this issue.

Hi Jaspreet,


Thank you for sharing the sample spreadsheet.

We have evaluated the presented scenario while using the latest version of Aspose.Cells for Java 8.6.2.4 and following piece of code. Unfortunately, I am not able to observe the problem on my side. You may check the attached snapshot for the output rendering in different browsers, and the text in header is displayed correctly in white color. Could you please confirm you are using the latest version using the CellsHelper.getVersion method? In case you are using 8.6.2.4, please share more details of your environment (Operating system, JDK, browser etc).

Java

System.out.print(CellsHelper.getVersion());
Workbook book = new Workbook(dir + “test.xlsx”);
book.save(dir + “output.html”, SaveFormat.HTML);

Hello,


I am taking the HTML output of only the table - Table1 and not the entire workbook. In case of table’s HTML, the issue does appear.

I am using the following sample code to take HTML of Table1 in the attached excel sheet :

String worksheetName = “Sheet1”;
String tableName = “Table1”;
Workbook workbook = new Workbook(“D:\test.xlsx”);
Worksheet worksheet = workbook.getWorksheets().get(worksheetName);

ListObject table = worksheet.getListObjects().get(tableName);
Worksheet newWorksheet = table.getDataRange().getWorksheet();

Range sourceRange = table.getDataRange();
if (table.getShowHeaderRow())
{
//Include table’s header row
int fcol = sourceRange.getFirstColumn();
int frow = sourceRange.getFirstRow() - 1;

// including the first header row.
int rowCount = sourceRange.getRowCount() + 1;
// including the first header row.
int colCount = sourceRange.getColumnCount();

sourceRange = newWorksheet.getCells().createRange(frow, fcol, rowCount, colCount);
}

Workbook newWorkbook = new Workbook(FileFormatType.XLSX);
WorksheetCollection targetWsc = newWorkbook.getWorksheets();
Worksheet targetWs = (Worksheet)targetWsc.get(0);
Range targetRange = targetWs.getCells().createRange(0, 0, sourceRange.getRowCount(), sourceRange.getColumnCount());
PasteOptions options = new PasteOptions();
//Copy column widths
options.setPasteType(PasteType.COLUMN_WIDTHS);
targetRange.copy(sourceRange, options);

// Copy row heights
int rowCount = sourceRange.getRowCount();
int firstRow = sourceRange.getFirstRow();

for (int i = 0; i < rowCount; i++) {
double rowHeight = sourceRange.getWorksheet().getCells().getRowHeight(firstRow++);
targetWs.getCells().setRowHeight(i, rowHeight);
}
//Copy everything else
options.setPasteType(PasteType.ALL);
targetRange.copy(sourceRange, options);

HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions(SaveFormat.HTML);
htmlSaveOptions.setParseHtmlTagInCell(true);

newWorkbook.save(“D:\test.html”, htmlSaveOptions);

Can you please analyze this issue again with the above sample code.

Thanks,
Neha

Hi Neha,


Thank you for sharing the code snippet.

We are able to replicate the said problem on our end, and it seems that the problem occurs while copying the ranges to new Worksheet/Workbook because if you save the result in spreadsheet format, the ListObject’s header font color is not same as of the original document. We have logged this incident in our bug tracking system as CELLSJAVA-41645. Please spare us little time for proper analysis. In the meanwhile, we will keep you posted with updates in this regard.

Hi again,


This is to update you that we have fixed the problem logged earlier as CELLSJAVA-41645. We will shortly provide the fix here after ensuring the quality of the build and incorporating other enhancements.

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


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