The issues you have found earlier (filed as CELLSNET-45478) have been fixed in this update.
Apologies for the delay first as we got engaged in another critical release.
With the latest release, we found few issues which i would like to highlight here.
- Images are not loading after saving the file as xls
- Alignments are misaligned in the xls file
- If we save the file as xls with mhtml options, unable to open the file.
- DetectFileFormat method is not providing the values
DetectFileFormat.png (8.7 KB)
Aspose.zip (124.2 KB)
I have attached the output file and screenshots for your validation. Please check and let me know if any other details required.
Thanks for the sample files and screenshots.
Your so called original XLS file is a web page. We will check your issues soon but we need more details for some of your mentioned issue:
- Could you paste the code segment on how do you save your XLS to MHtml.
- Please paste your code to evaluate your issue precisely.
Thank you.
Yes, if you see our initial discussion we are talking about the mhtml file saved as .xls (generated from 3rd party application)
Please find the requested code details.
1.Could you paste the code segment on how do you save your XLS to MHtml.
workbook.Save(@"C:\Users\dektop\newFile.xls", SaveFormat.MHtml);
-
Please paste your code to evaluate your issue precisely.
Load with mhtml option and save as xls file (original file is xls)
LoadOptions ldps = new LoadOptions(LoadFormat.MHtml); var workbook = new Workbook(filenamewithPath, ldps); workbook.Save(@"C:\Users\Desktop\recent\newcreated.xlsx");
After an initial test. I am able to reproduce the issues you mentioned. By the way. when you save to MHtml file, please always use the line like following:
workbook.Save(“e:\test2\out1MHtml.mht”, SaveFormat.MHtml);
Details:
- It looks like Aspose.Cells API does not read your MHtml file fine as when we save it as XLS/XLSX or MHT, the Images are lost and formattings are removed.
Issues:
-
Images are not loading after saving the file as xls
-
Alignments are misaligned in the xls file
e.g
Sample code:LoadOptions ldps = new LoadOptions(LoadFormat.MHtml);
var workbook = new Workbook(“e:\test2\original.xls”, ldps);
workbook.Save(“e:\test2\out1XLS.xls”, SaveFormat.Excel97To2003);
workbook.Save(“e:\test2\out1MHtml.mht”, SaveFormat.MHtml);
The issue is logged with an id “CELLSNET-45538” as:
Images lost and formattings are removed when saving an MHtml file to XLS or MHT.
- Aspose.Cells APIs does not detect your MHtml file format fine. I used your sample MHtml file but it detects as Unknown.
Issues:
- DetectFileFormat method is not providing the values
e.g
Sample code:
string fileName = “e:\test2\original.xls”;
var o = FileFormatUtil.DetectFileFormat(fileName);
Console.WriteLine(o.LoadFormat.ToString());//Unknown - Not Ok;
The issue is logged with an id “CELLSNET-45539” as:
Aspose.Cells does not detect MHtml file format
Once we have any new information on any of the above fixes, we will let you know here.
Thank you.
Regarding issue “CELLSNET-45539”:
Please remove the top three lines:
From: Created by Oracle BI Publisher <>
Message-ID: <1727253119.1171158.1498780541748.JavaMail.obi2@anonymous.anonymous.com>
Subject: Created by Oracle BI Publisher
The MHtml file should starts with MIME-Version: 1.0, then we can detect it as a valid MHtml file.
Thank you.
Thanks for the quick response. Please find my response for your suggestions.
We are saving the file as xls since we are not supposed to change the file format received from external source. So this option is ruled out.
Again, we are not supposed to change the original file received from source system.
Is there any other way we can fix this without changing the original file from the source?
When your MHtml file is saved with XLS extension, MS Excel will also show errors when opening the file into it.
I am not sure if there is any other way around to cope with it. I have logged your concerns against your issue “CELLSNET-45539” into our database for product team’s investigations.
Once we have an update on it, we will let you know here.
Thank you.
Please try our latest version/fix: Aspose.Cells for .NET v17.7.5:
Your issue “CELLSNET-45539” should be fixed in it.
Let us know your feedback.
Thank you
Thanks for sharing the latest fix. As you sent last time, can you please zip and password protect this file and send it to my email id which i have messaged you last time.
The latest fix/version (Aspose.Cells for .NET v17.7.5) was sent @ your mentioned email id.
Thank you.
We have done testing with various scenarious and below are our findings.
- Able to get the FileFormatType now using FileFormatUtil.DetectFileFormat method.
- When using MHTML loads options, we found below alignment issue in the resulting output file (xls, .xlsx).
- Newly generated excel file contains the empty space in-between the rows (e.g.: row number 11, 12, 17, 18, 20, and 21). Refer to the figure-1.
- Company log is missing in the resultant Excel.
- Row formatting is missed in the resultant Excel.
- When not using MHTML loads options, we found below alignment issue in the resulting output file (xls, .xlsx).
- Newly generated excel file contains the empty space in-between the rows (e.g.: row number 11, 12, 17, 18, 20, and 21). Refer to the figure-5.
- Company log is missing in the resultant Excel.
- Row formatting is missed in the resultant Excel.
I have attached the validation documents which contains all these details with resultant output files, screenshots for your reference.
Aspose_Validation.zip (217.2 KB)
Request you to check and let us know if you need any details.
Thanks for the document with issues details.
We have logged your document against against your issue logged tickets into our database.
The following issues (as sub-tasks for “CELLSNET-45538”) are already created for your issues:
- CELLSNET-45556 - Images lost after saving the file as XLS
- CELLSNET-45557 - Formatting lost after saving the file as XLS
- CELLSNET-45558 - When MHtml file is saved with XLS extension, MS Excel shows errors when opening the XLS file into it.
Once we have any further updates, we will let you know here.
PS. We always appreciate if you could create separate threads to highlight one issue per thread. This way, nothing would be missed while sorting out issues.
Thank you.
Please try our latest version/fix: Aspose.Cells for .NET v17.8.2:
Aspose.Cells for .NET v17.8.2 (.NET 2.0)
Aspose.Cells for .NET v17.8.2 (.NET 4.0)
The following issues (logged as sub-tasks for “CELLSNET-45538”) are resolved:
CELLSNET-45556 - Images lost after saving the file as XLS
CELLSNET-45558 - When MHtml file is saved with XLS extension, MS Excel shows errors when opening the XLS file into it
CELLSNET-45597 - “Number stored as Text” for the numeric columns
Let us know your feedback.
Thank you.
Thanks for the fix again. As shared last time, Please email me the attachment with password protected.
Regards,
Senthil
Yeah, got it !!! thanks.
We have retested the scenario’s again with latest dll and can still see the formating issue exists in the resulting output file. We can see logo displayed in the file now.
CELLSNET-45557 - Formatting lost after saving the file as XLS - Open
Output.zip (13.7 KB)
Refer the attached documents for your validation. Please check and let me know if you require any more details on this.
Yes, the issue (logged earlier as “CELLSNET-45557”) is not fixed yet. The issue is In Progress. Please spare us more time. Once we figure it out, we will update you here with the fix.
Thank you.