Hi,
I have a question regarding aspose cells for java. When saving excel file as html using HtmlSaveOptions, is there a way for hidden rows and columns to be visible in html file? I saw that there are methods setHiddenColDisplayType() and setHiddenRowDisplayType() which have parameter of ‘HtmlHiddenColDisplayType’ (or ‘HtmlHiddenRowDisplayType’) type, which has ‘HIDDEN’ and ‘REMOVE’ possible values. Neither of them will show hidden rows and columns when opening html file with browser (although when using ‘HIDDEN’ there will be cells from hidden rows/columns in html code, but it will have ‘overflow:hidden’ style so they won’t be shown in browser). Is there a way to show those hidden columns/rows when opening html file using browser, when saving the excel file as html?
Regards,
Milorad
@Milorad,
Thank you for your query.
Please note that setHiddenColDisplayType()/setHiddenRowDisplayType() decides whether the hidden columns/rows in the source Excel file shall be maintained in the output HTML file or not. If you use HIDDEN, it will keep the information in the output HTML file but not UNHIDE it. Whereas REMOVE will remove the hidden information from the HTML file resulting in smaller HTML output file. Both of these flags will not UNHIDE rows and columns but will only decide whether hidden rows/columns will be removed or maintained in the output HTML file.
If you want to unhide the rows/columns in the output HTML file, you may first unhide them in the template Excel file and then convert it to HTML.
@ahsaniqbalsidiqui,
Thanks for your answer.
One more question, is there a way to get row numbers and column letters from worksheet displayed when saving excel file as html?
@Milorad,
I think you may try using HtmlSaveOptions.ExportHeadings and HtmlSaveOptions.ExportGridLines Boolean attributes for your needs.
Yes, I just tried it and it works, thanks!
Is there any way to highlight currently opened tab, on a way it is highlighted in MS excel, or something similar? I saved some excel file to html but every tab name looks the same, no mather which tab is opened. (look at the attached screenshot)
pic.png (63.9 KB)
@Milorad,
Thanks for the screenshot.
You can specify the sheet tab color using the following line:
e.g
Sample code:
.......
workbook.getWorksheets().get(0).setTabColor(Color.getYellow());
but this will only work if you are saving in MS Excel file formats (e.g XLSX). If you are saving to HTML file format this will not work. Please note this limitation is with HTML format itself and nothing to do with Aspose.Cells APIs. You can confirm this limitation when saving an Excel file to HTML (Web page) in MS Excel manually, so you will see tab color is not set in the output HTML file at all.