- 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
Joined: Sep 19, 2013
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..
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.
Isn't it funny how there's always time and money enough to do it WRONG?
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.
Joined: Jun 07, 2013
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.
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...
Joined: Jun 07, 2013
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.