Focal Point
Right click HTML and output to Excel

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8981067331

December 23, 2003, 01:20 PM
Jenn McMaster
Right click HTML and output to Excel
I have read some posts out there on how you can right click your outputed report in the HTML table and have an option to send it to Excel. How does that work? I have not heard of this function before? Is this part of WebFocus or is this additional code added to the report?

Thanks,
JLM
December 24, 2003, 02:49 AM
<Viswa>
Hai

Let the fex file name be 111.fex
The Code in this will be..
----------------------------
-DEFAULT &FORMAT = HTML

TABLE FILE CAR
PRINT
MODEL
CAR
ON TABLE SUBHEAD
"Download to Spreadsheet"
ON TABLE SET ONLINE-FMT &FORMAT
ON TABLE SET STLE *
TYPE = TABHEADING, FOCEXEC = 111(FORMAT = 'EXL2K'), $
ENDSTYLE
END
----------------------------------

The above code will generate a HTML report, which on Clicking the Icon will open the same report in Excel.

Thanks
Viswakanth
December 29, 2003, 03:09 PM
<mhuber>
Viswa,
That's a pretty cool solution!! I had no idea WF could do some of the things it can. 8^) The major drawback I see is that it re-queries the database (though it's not a concern for everyone).

Jenn,
As for the right-clicking, I believe this is a function of MS Internet Explorer rather than WebFOCUS. If you right-click on any HTML table, you'll get an option to "Export to Microsoft Excel" (we use IE6). This doesn't seem to work properly in our environment, though. We're using servlets through the MRE, so maybe that has something to do with it. As a bit of a workaround, we're able to save the HTML to the desktop, then open it back up, and it will export just fine.

I hope this helps.
-Michael
December 29, 2003, 04:15 PM
Jenn McMaster
I have IE6 as well. I don't have Export to Excel in my right click menu. Is this something that needs set in the options or something? I couldn't find this option anywhere! Should it automatically be there or is there special setup steps for this feature?

Thanks,
Jenn
December 29, 2003, 04:35 PM
Jenn McMaster
I think this option may only be available with Office XP. I have Office 2000.

Frowner
Thanks
December 29, 2003, 04:41 PM
Jen
Viswa,
Now THAT is a cool trick! Thanks for posting that.

Michael,
I think Jenn is right, that option for Exporting to Excel is probably an XP thing. We are using 2000, and that doesn't work for us either.

Jen
December 29, 2003, 06:32 PM
<mhuber>
Turns out it's an Excel XP thing (aka Excel 2002). Here's an excerpt from MS TechNet:
http://www.microsoft.com/technet/treeview/default.asp?u...skit/html/wgtd04.asp

With Excel 2002 and Internet Explorer 4.0 or later, you can also create a Web query directly from a Web page. Menu items have been added to Internet Explorer (Edit in Microsoft Excel on the Internet Explorer toolbar and Export to Microsoft Excel on the right-click context menu) to allow users to export Web page content or an entire Web page to Excel. When you choose these commands, Excel opens, creates a new blank workbook, and automatically imports the data you clicked.


For those without Office XP... luckily, we still have Viswa's solution! 8^)
-Michael
January 06, 2004, 08:41 PM
susannah
NOTA BENE: "right click export to excel" DOESN'T WORK WITH SERVLET.
it works like a dream with ISAPI.
Its so much better than pchold excel output, because 1) it goes in to real excel, 2) you can have multiple excels open. Neither is true with pchold: its only an xml viewer and you can only have 1 open at a time.
so,..
if you have a selfserv app, you can override your servlet setting by changing the calls to the cgi in your forms to WEBAPI.dll
and you can make sure your drilldowns use the command SET FOCEXURL to whereever your WEBAPI.dll is, rather than servlet.

This message has been edited. Last edited by: susannah,
February 09, 2004, 11:27 AM
<Viswa>
Hai Susannah

Could you explain a bit about what you have said
**************
NOTA BENE: "right click export to excel" DOESN'T WORK WITH SERVLET.
it works like a dream with ISAPI.
It does NOT re-execute the fex or reread the database, as one of the commenters above said.
It merely takes the html table and zaps it into excel.
Its so much better than pchold excel output, because 1) it goes in to real excel, 2) you can have multiple excels open. Neither is true with pchold: its only an xml viewer and you can only have 1 open at a time.
so,..
if you have a selfserv app, you can override your servlet setting by changing the calls to the cgi in your forms to WEBAPI.dll
and you can make sure your drilldowns use the command SET FOCEXURL to whereever your WEBAPI.dll is, rather than servlet.
We can't roll out the MRE site we've just built because it doesn't work with servlet.
*********************

I could make some Conclusion from your response, that, we can generate an excel report, without touching the database.
Can you explain me the above trick with an example?

Thanks
Viswakanth
February 25, 2004, 12:52 PM
Tim J
Viswa:

I tried the tip to add the option of clicking the link to requery in an Excel format, but my report just requiries in the HTML format again. I don't have 'EXL2K', so I used 'EXCEL' as my format.

I have WebFOCUS 4.3.6 SP 7. Maybe that is my problem?

Thanks,
Tim
February 25, 2004, 09:18 PM
susannah
viswa, sure.
if you have windows XP, then when you generate an HTML table in focus, and you use a self-serv application (not MRE) in your call to webfocus you have used method=get, not method=post, and you can use cgi, isapi, or servlet (as it turns out servlet works fine too).
then...
when the table shows on your screen, just put your cursor in the table anywhere, click right, bring up the windows menu, click the option export to excel, and bingo! real excel opens and your html slots right into it. And youcan keep it open as you continue to work in your webfocus app. pretty slick!
It doesn't work from MRE, at all.
It won't work unless you have at least windows XP.
It won't work unless your calls to webfocus from your forms use 'method=get';
April 05, 2007, 03:43 PM
CathyB
I've been reading all I can on this "export to excel" function. I know the function works here because we have a dashboard that IB developerz built for us and you can right click and export them to excel - and it even enables the drill downs. However if I build a fex and generate an HTML file and try to export it it tells me no data was returned and to edit the query. What am I doing differently????. Also, there stuff is way complicated - but I will tell you that the the report fex that feeds the HTML dashboard layout doesn't export if you just run the fex. It only exports if you access from the dashboard.

I hope that makes sense, I'm pretty new at this stuff - like a super user at best, trying to be a developer. I see a lot of info on METHOD=GET I'm not sure where to apply that, or if I even should.

Any help would be great - and don't hesitate to ask questions that I probably already should of included - because I'm really, really new at this stuff.


WEBFOCUS 7.14
WEBFOCUS.8.04
April 05, 2007, 05:11 PM
Tony A
I hate to be the bearer of bad news but to get the context menu "export to excel" to function you need certain things -

Excel 2002 - as has been mentioned
A well formed URL in the browser address bar - as the URL is actually used in creating a web query. So unfortunately, the data is re-extracted.

The auto prompt function uses method=post on the form so the URL does not contain the necessary components to enable the web query to be built. The autoprompt.xsl file should be responsible for building the auto prompt frames.

Sorry to burst the bubble but you need to know ....

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
April 05, 2007, 05:43 PM
susannah
all..
we have an article on this feature on Focus On Developers...
yes indeed it does reexecute the fex( what was i thinking??)
and it works from HTML (self serve) if your focus engine is ISAPI or CGI. Its BillGates talking to BillGates. It builds a refreshable webquery for your users, and our users here love it. I would suggest you have a read of the article, and you'll get details.
You can experiment with public sites such as
http://www.x-rates.com/ or this one http://www.exchangerate.com/
Put your cursor on the ex rate table, and clickright and export. Lots of public sites allow you to refresh your data this way.
heres another, tbill rates

This message has been edited. Last edited by: susannah,




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
April 06, 2007, 09:43 AM
jgelona
I would like to add that it appears to be an OFFICE 2002 and higher function. My PC OS is W2K, but I have OFFICE 2003 and it seems to work for me.

This is one of my favorite sites. I learn something new every day.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.