Free Support Forum - aspose.com

Opening HTML report at runtime

Hi,

Is it possible to open a report in HTML format at runtime?

I am binding values from my dataset to workbook and inserting images also.

I want to show them in a HTML report with data and images.

How to generate HTML report at runtime ?

Thanks

Ashok

Hi,

ashokk:

Is it possible to open a report in HTML format at runtime?

Well, Aspose.Cells only supports to save/save as html file format, it does not support to open/parse existing html files to manipulate / re-save it.

ashokk:

I am binding values from my dataset to workbook and inserting images also.

I want to show them in a HTML report with data and images.

How to generate HTML report at runtime ?

Please check the thread: http://www.aspose.com/community/forums/thread/169753.aspx We also recommend you to use our latest version or fix (4.7.0.x)

I write a sample code here.

Sample code:

Workbook workbook = new Workbook();
//
//your code goes here
//
workbook.Worksheets[0].Cells["A1"].PutValue("Hello World!");
//
//your code goes here
//
workbook.Save("myreport.html", FileFormatType.Html);

Thank you.

Hi,

Thank you for considering Aspose.

Please try the attached latest version of Aspose.Cells for Java. We have supported the feature to import the HTML files.

Thank You & Best Regards,

Hi Nausherwan,


I’m trying to convert an HTML document with a simple two column table to Excel using Aspose.Cells for Java and having trouble getting it to work. I downloaded the Aspose.Total package in April 2010. I’m not sure what exact version of Cells I have, since it’s not shown in the README, the main page of the javadoc, or the manifest inside the JAR file. Here’s the code I use to open the HTML file, which results in a Workbook with a single empty Worksheet:

Workbook workbook = new Workbook();
workbook.open(“index.html”, FileFormatType.HTML);

Is this the right way to do it?

Thanks,
Matt

Hi,

Please post your template HTML file, we will check your issue soon.

Thank you.

Here’s some test HTML and CSS which results, at least for me, in a Workbook containing one empty Worksheet.


–Matt

Hi Matt,

Thanks for providing us the template html file.

Well, Aspose.Cells for Java only supports reading Html files which are MS Excel oriented ( saved as web page in MS Excel) with some limitations. Anyways, I have logged an issue into our issue tracking system with an id: CELLSJAVA-18121. We will investigate and get back to you soon.

Thank you.

Hi Amjad,

Ah, I see. In the short-term, one idea I had was to convert the HTML table into CSV and then read it in using the method Workbook.open(InputStream stream, char separator, boolean convertNumericData, String charsetName). It wouldn't be easy to do in the general case, but since my HTML happens to be so simple, it shouldn't be too difficult in my case. Sound reasonable?

Thanks,
Matt

Hi,

I am afraid currently we cannot support such kind of
common html file which was not generated by MS Excel. I think saving a CSV file
as intermediate format is a good workaround.

Thank you.