Aspose Excel Conversion

While using current version of Aspose we are facing challenge to establish link between RAW excel spreadsheet uploaded and HTML converted.

As per business requirement, we need to have unique identified to link uploaded Excel file with HTML conversion [Ex: Excel Cell linking with corresponding HTML conversion]

Can you please help us with the solution.

Regards,

Divesh Salian

Hi,


Do you need Excel-to-HTML conversion i.e. convert Excel file to relevant HTML file? This feature is supported by the product. See the sample code below:

Sample code:

Workbook workbook = new Workbook(@“E:\test2\Source.xlsx”);
workbook.Save(@“E:\test2\outputFile.html”, SaveFormat.Html);

Let us know if you still have any confusion or have other queries or issues, please give us more details and we will be happy to assist you.

Thank you.

Hi,


I am facing a problem related to Excel converted as HTML.
Is there a way I can retain any link back to original source Excel file in my converted HTML document.

I follow the following scenario:
1. User uploads Excel file (xls, xlsx, xlsm)
2. Convert it to HTML using Aspose conversion.

This conversion clear all the values other than formatting and text values of cell. I want to retain formula value for the cell too in my HTML file along with Links back to my original Excel sheet.

Can you help?
We have purchased total licence for aspose.

Regards
Virendra

Hi,


Please try our latest fix/version: Aspose.Cells for .NET v7.3.3.2

If you still find the issue, please attach your sample input Excel file(s) and converted HTML file(s) via Aspose.Cells for .NET (you may zip the archive if you want). Also attach your expected HTML file(s) to show the issue. We will look into it soon.

Also, the HTML conversion (via Aspose.Cells) is same as what MS Excel does (you may check/confirm this: open the Excel file into MS Excel and then save it as html or web page(manually)).


Thank you.

Hi,


Thanks for the quick reply.
Now I can see formula related to cell in html file as well.

Can I access the Name property of excel range in GridWeb?
If yes, please tell me how?

I am importing the converted html (from excel) file to GridWeb and changing certain values. Now I want to access Name (Name as given in excel) of a cell. But I am unable to find a method for the same.

Regards
Virendra
Hi,

virendra.ray:

Can I access the Name property of excel range in GridWeb?
If yes, please tell me how?

I am importing the converted html (from excel) file to GridWeb and changing certain values. Now I want to access Name (Name as given in excel) of a cell. But I am unable to find a method for the same.

Well, you may use Aspose.Cells.GridWeb.Data.Name and Aspose.Cells.GridWeb.Data.NameCollection APIs for your needs in GridWeb. See the topic for reference:

Working with Named Ranges

Thank you.

Hi,


While importing one of my xlsm file into GridWeb I am getting exception “Not a legal OleAut date.”.
But I don’t see any date Cell in the Sheet.

How to resolve such kind of errors which stops loading of excel file to Gridweb?

Regards
Virendra
Hi,

virendra.ray:

While importing one of my xlsm file into GridWeb I am getting exception "Not a legal OleAut date.".
But I don't see any date Cell in the Sheet.

How to resolve such kind of errors which stops loading of excel file to Gridweb?


Please attach your template file here, we will check your issue soon.

Thank you.

Hi,


I want to edit HTML table() in GridWeb and also wants to save the details back to the html table.
Is it possible using Aspose.Cells.GridWeb??

If not, request you to provide alternate solution using GridWeb.

Regards
Virendra

Hi,


I am afraid currently Aspose.Cells.GridWeb control only supports to read/write XLS, XLSX/XLSM, and CSV formats into its grid/matrix. I have logged a ticket with an id: “CELLSNET-41205” for your feature request. We may look into it in future versions though.

As a workaround, you may try to use Aspose.Cells library that does support to read/write or manipulate HTML files if it could fit your needs.

Thank you.

Hi,


I am saving attached excel as HTML using Aspose.Cells.Workbook.
But the desired output is not similar to what I get using Excel saveAs option.

I have also attached zip file containing the 2 html files for your reference.
What option we can apply in Aspose to get exactly similar output as given by excel, but preserving formula information as Apsose conversion does.

Also at the cell where a Formula exists, its data value is missing in html file.

Regards
Virendra

Hi,


I have tested your scenario using your template Excel file to convert to HTML and it works fine. The output HTML file looks to me almost same as per the original Excel file except for a few minor formatting things. The formulas’ calculated values are fine. I have used our latest version/fix: Aspose.Cells for .NET v7.3.4.1. Please try it.

Also, your html files cannot be seen as you did not provide their source files and elements.

I have attached my output HTML file with its source files in the attached zipped archive.

If you still find any issue, kindly give us some screen shots to highlight the problematic areas (encircling with red color) comparing your original and output HTML files. It will help us to find the issue.


My Sample code goes here:

Workbook workbook = new Workbook(@“E:\test2\saveexcel\output.xls”);

workbook.Save(@“E:\test2\saveexcel\output_1.html”, SaveFormat.Html);




Thank you.

Hi,

I have saved few of my HTML files as .xls and when I open these files using Microsoft excel, it gives me a warning but I m able to see my excel file and I can edit and save it as normal .xls file.
But using Aspose.Cells.WorkBook in same scenario is giving me error. It is not loading the .xls file.
How to open this .xls file (saved from HTML) in Aspose Workbook?
Is there any method I can force workbook to load the file having .xls file, irrespective of warnings?

Regards
Virendra

Hi,


Please attach your template files (i.e…, input html file and output XLS file (by Aspose.Cells) which you could not load/open by Aspose.Cells.Workbook object). Also paste your sample codes here. We will check your issue soon.

Thank you.

Hi,


html and .xls files are in zip file attached.
I have saved html file using following code
StreamWriter file;
StreamReader rd = new StreamReader(str_tempHTMLPath);
input = rd.ReadToEnd();
formatHTMLTable();
file = new StreamWriter(str_tempxlsfile);
file.Write(input);
file.Close();
rd.Close();

Now I want to open this .xls file using Workbook
Workbook workbook = new Workbook(rd);
workbook.Save(str_tempxlsfile, SaveFormat.Excel97To2003);

But I am getting exception at Workbook workbook = new Workbook(rd);

Regards
Virendra

Hi,


I tried opening your so called XLS file and found errors in MS Excel too, so your file is not a standard XLS file that MS Excel supports for doing your way. We follow MS Excel standards, so you may get the error opening such a file via Aspose.Cells APIs.

I am not entirely sure about the process you are using? Are you taking your attached HTML file into the streams and then create a new file (you are trying to create a new XLS file but this might not the correct way) first and then write the html data/contents to it. Now you are using Aspose.Cells.Workbook object to open/load the file.

Here is the sample (runnable) code that I tried:

Sample code:

StreamWriter file;
StreamReader rd = new StreamReader(“e:\test2\veerugr.html”);
string input = rd.ReadToEnd();
//formatHTMLTable(); – Not sure about this method either.
file = new StreamWriter(“e:\test2\Veeru.xls”); // This line will not create a native Excel file, so its format would be unknown. MS Excel will give error opening into it.
file.Write(input);
file.Close();
rd.Close();

Workbook workbook = new Workbook(“e:\test2\Veeru.xls”); //Got error: This file’s format is not supported or you don’t specify a correct format.
workbook.Save(“e:\test2\vout2.xls”, SaveFormat.Excel97To2003);

Hi


Sorry, I posted the same problem once again.

Regards
Virendra

Hi,


Is there any way I can achieve this?
HTML to Excel and open the excel in Workbook.

Please guide through some work around.

Regards
Virendra Kumar

Hi,

Thanks for your posting and using Aspose.Cells.

Aspose.Cells can convert Html file into Ms-Excel file, how it cannot deal with all types of html all the time.

It mostly deals successfully with the Ms-Excel generated html. For example, if you save your workbook into html format using Ms-Excel, then load it back using Aspose.Cells , then Aspose.Cells will not complain anything and load your html file into a workbook object.

Once, you got the Workbook object, you can then save it back in many formats e.g html, pdf, xls, xlsx or xlsm

For more information, please see the following articles for your reference.

Hi,


I am using following code to save XLS file as html using aspose

FileStream fs = File.OpenRead(str_outputFilexls);
Aspose.Cells.License lc = new Aspose.Cells.License();
lc.SetLicense(@“C:\Program Files (x86)\Aspose\Aspose.Cells for .NET\Demos\C Sharp\Web\Aspose.Cells.GridWeb\aspose\Aspose.Total.lic”);
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(fs);
///wb.Worksheets.Add();
wb.Save(str_outputFilehtml, SaveFormat.Html);

wb = null;
fs.Close();

But cells which contains formula are not having any value in HTML file.
Also if the column width is not proper in excel, html contains ########## as value.
I am also having problems with values which are not wrapped.
Please provide the solution.

Regards
Virendra