Hi, I am using Aspose.cells to convert html tables into excel but they do not keep the borders, not also the background color. If I open the html file using excel software it renders the styles correctly. What might be the issue?
We were able to observe the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.
This issue has been logged as
CELLSNET-46366 - Borders and background colors are missing while converting the HTML to XLSX
Hi, I am using Aspose.cells to convert html tables into excel but styles and image is not reflecting in excel which is of type xlsx format.
I am using aspose.cell version 18.
Below is the code to export :
string dir = @“directoryName”;
string FileName = “HCP_Fees_for_Services_and_Consultancy_20181114114513242.html”;
string inputfileName = dir + FileName;
string outputfileName = dir + “checkdatasa.xls”;
Aspose.Cells.HTMLLoadOptions hTMLLoad = new Aspose.Cells.HTMLLoadOptions(LoadFormat.Html);
hTMLLoad.IgnoreNotPrinted = true;
if (File.Exists(inputfileName))
{
Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook(inputfileName, hTMLLoad);
Aspose.Cells.Worksheet worksheet = null;
if (workbook != null)
{
worksheet = workbook.Worksheets[0];
worksheet.PageSetup.PrintTitleRows = "$1:$3";
}
//workbook.Save(outputfileName,SaveFormat.Xlsx);
worksheet.PageSetup.Orientation = Aspose.Cells.PageOrientationType.Portrait;
worksheet.Workbook.Save(outputfileName);
We need your template HTML file (you may zip it prior attaching) to evaluate your issue precisely. Please provide us your template HTML file, we will check it soon.
After an initial test, I am able to observe the issue as you mentioned by using your sample code with your template file. I found that formattings are lost in HTML to XLS rendering. I have logged a ticket with an id “CELLSNET-46447” for your issue. We will look into it soon.
Once we have an update on it, we will let you know here.
The issues you have found earlier (filed as CELLSNET-46366) have been fixed in Aspose.Cells for .NET v18.11. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi
Hi Support ,
i appreciate that you solved this bug so quickly. Kudos!
One thing that image in html is still not coming in excel sheet.
Other is that width and height of the columns and rows differs in html to excel.
Thanks.
When I open your template HTML file into the browser or Ms Excel, the image (rather linked image) is also not shown either, so the converted XLS file by Aspose.Cells also does not display the image. See the screenshot for your reference:
Well, we added a line to your code segment to make the view more compact:
// add this line to get better result
hTMLLoad.AutoFitColsAndRows = true;
The issues you have found earlier (filed as CELLSNET-46447) have been fixed in Aspose.Cells for .NET v18.12. This message was posted using BugNotificationTool from Downloads module by Amjad_Sahi