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

Free Support Forum - aspose.com

Horizontal borderline continues all the sheet in the html output

Hi support,

I’m using Aspose.Cells version 20.2.0.0 and when having this excel file as input
Excel input.JPG (122.2 KB)
the horizontal border lines that can be seen on the right only, go all the way to the left in the HTML output file as you can see here
Output.JPG (24.9 KB)

Could you help us in understanding why this is happening and how we could accomplish getting the output just like the Excel sheet looks like?

Sample code:

        string inputExcelPath = Path.Combine(Environment.CurrentDirectory, @"..\..\..\..\Excel.xlsx");
        string htmlFilePath = Path.Combine(Environment.CurrentDirectory, @"..\..\..\..\output.html");

        var workbook = new Workbook(inputExcelPath);
        var sheet = workbook.Worksheets[workbook.Worksheets.ActiveSheetIndex];
        var htmlSaveOptions = new HtmlSaveOptions
            {
                ExportHiddenWorksheet = false,
                HiddenColDisplayType = HtmlHiddenColDisplayType.Remove,
                HiddenRowDisplayType = HtmlHiddenRowDisplayType.Remove,
                ExportActiveWorksheetOnly = true
            };

        sheet.Workbook.Save(htmlFilePath, htmlSaveOptions);

I’m attaching all files in the zip file.
Unexpected horizontal borderline.zip (121.1 KB)

Thanks

@ServerSide527,

I manually render the HTML file (“Web Page”) in MS Excel and got the same results as Aspose.Cells produces, so it is not an issue rather sort of limitations of MS Excel which does not produce the same thing (when rendering HTML) that is shown in Excel. Even when taking the print preview of the sheet does not show your desired output, so setting and exporting printable area won’t have any effect. Aspose.Cells follows MS Excel standards and specifications when rendering to HTMLs, so it cannot be done directly either by MS Excel or using Aspose.Cells APIs.

Hi @Amjad_Sahi,

Thank you very much for such a prompt response, we’ve checked on our side and yes, seems like Excel has got a bug. Those lines were created selecting a whole row and then applying some formatting on top, which in Excel does override the previous row formatting but in the .HTML output seems like all the formats are applied.

Regards

@ServerSide527,

Yes, this is MS Excel’s behavior when rendering to HTML file format. In the event of further queries or issue, feel free to write us back, we will be happy to assist you soon.