This week's book giveaway is in the JavaScript forum.
We're giving away four copies of JavaScript Promises Essentials and have Rami Sarieddine on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes opening xl sheet in html formate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "opening xl sheet in html formate" Watch "opening xl sheet in html formate" New topic
Author

opening xl sheet in html formate

satyab kumar
Greenhorn

Joined: Sep 19, 2013
Posts: 2
hi,
i want show my exel sheet results as html format .can any body please tell me how to open excel sheet as html sytle...




Ahsan Bagwan
Ranch Hand

Joined: Oct 05, 2010
Posts: 162
Break your problem into small subproblems.

If this was my task, I would break it down into,

- Read the excel file using a library like Apache POI . Its Excel component specifically.

- Separate the presentation by using some other module which displays the results in the HTML
satyab kumar
Greenhorn

Joined: Sep 19, 2013
Posts: 2
thanks for your reply,

let me explain my problem actually i am automating my project from manual Testing to Automation testing through selenium .After automation done i am showing results as xl format.

my task is

1) i need to provide one hyper link in xl sheet.when click on that hyper link it will display another detailresult xl sheet.But i need to show these detail results xl sheet as html style not xl formate .i am not getting idea how to do..

Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8176
    
  23

satyab kumar wrote:1) i need to provide one hyper link in xl sheet.when click on that hyper link it will display another detailresult xl sheet.But i need to show these detail results xl sheet as html style not xl formate .i am not getting idea how to do..

Well first off, your requirements are just about as difficult as anyone could possibly have made them.

1. Why do you need the "linked" spreadsheet to be in HTML format, but not the original?
2. Why do you need a spreadsheet to be in HTML format at all?
3. If you need all this "customization", why pick a proprietary format like Excel?

Unless things have changed a lot since I was doing this precise thing (automated conversion of Office documents to HTML), there is nothing better for converting an Excel spreadsheet to HTML than Excel's own "Save as HTML" function. Unfortunately, all Office software is proprietary and - unless you're willing to pay MS scads of money, or wrestle with their awful Office Automation tool (and believe me, it is truly abominable) - it does NOT give you "programmatic" access to that function.

If indeed you really have to do this, I'd be inclined to convert to OpenOffice or LibreOffice format first, and then try to do what you want; but I warn you, it will be not be easy.

Alternative: See if you can get whoever's asking for this to modify their requirements by telling them it'll take you 6 months to get a working prototype.

Winston

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Mark Beardsley
Ranch Hand

Joined: Jun 07, 2013
Posts: 32
    
    1
Slightly worried about posting to this thread but....

Take a look here - http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/ss/examples/html/ToHtml.java - someone who uses POI has written a class that can be used to convert into html. I do not know how complete it is but at least, it might serve as the basis for a solution.

Also, I have used JACOB - Java COM bridge - to convert Excel files into html. The limitation with this approach is that it is Windows only; I have never tried using Office running under Wine on an Linux box and so cannot comment on whether it would work at all in this environment. Also, there is UNO - Universal Network Objects - whihc is sort of like COM for OpenOffice. Have never done this myself but it might be possible to use OpenOffice to convert from Excel to HTML.

This would only address part of your requirement of course. I am going away to hide now.
Mark Beardsley
Ranch Hand

Joined: Jun 07, 2013
Posts: 32
    
    1
Getting old. I forgot about this - http://www.artofsolving.com/opensource/jodconverter - saves you from the horror (relatively) of using OpenOffices' UNO interface to create file conversion programs. It does rely on OpenOffice - I cannot speak for LibreOffice but it might also work - being installed on your machine.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 8176
    
  23

Mark Beardsley wrote:Getting old. I forgot about this - http://www.artofsolving.com/opensource/jodconverter - saves you from the horror (relatively) of using OpenOffices' UNO interface to create file conversion programs. It does rely on OpenOffice - I cannot speak for LibreOffice but it might also work - being installed on your machine.

Yeah, I remember seeing that a while ago too. It looks quite nice but, I must admit, I've never used it in anger. I also don't know if it gives you access to the "save as HTML" function, but it does look good for conversions. I wish it had been around when I needed it...

Winston
Mark Beardsley
Ranch Hand

Joined: Jun 07, 2013
Posts: 32
    
    1
Hello Winston. Re JODConverter, yes it does effectively give you access to the save as HTML function of OpenOffice. You can think of it in some ways as an analogue to COM. In the case of JODConverter, the Universal Network Objects (UNO) interface exposed by OpenOffice is used to access the applications' functionality - whereas with COM as I am sure you know. you control an instance of the application - and you can do anything a user of OpenOffice or LibreOffice would be able to do. UNO is very powerful but quite complex - there are object managers from which you request specific functionality and working your way through the hierarchy can be taxing. JODConverter protects you from this if all you want to do is perform file conversions. Sadly, it is no longer actively maintained but did prove itself to be useful for us.

Stll would not want to tackle the OP's problem myself though as all we have been able to do so far is tackle the conversion to HTML; the hyperlinks remain to be both defined and built.
 
Consider Paul's rocket mass heater.
 
subject: opening xl sheet in html formate