Focal Point
auto run a report when an html page opens

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

February 07, 2007, 02:56 PM
Wilky
auto run a report when an html page opens
I have an html page that I created in HTML layout painter that has 1 button and 1 frame. When the user clicks the button it runs a report in the frame. How can I get the report to run with default values as soon as the html page opens. I saw another thread on this but there really was no answer to it.


PROD: WF 7.1.3 on Win 2003/IIS 6/Self-Serve & MRE
TEST: We dont need no Stinking Test Server!
February 07, 2007, 04:14 PM
susannah
we donneedno steeenkeeeng test server..
i like that!
i can't rememeber the movie.
anyway
you can run a fex directly from a hyperlink, default values for all the parms.
eg, i have a navig frame , a launch page frame, and a main report area frame..
the links in the navig frame both load the appropriate launch page, and run a default version of the report. If the user wants more/different, they can pick parms from the launch page and knock themselves out.
here's what the link looks like:
<a onMouseOver="window.status='nice message goes here'; return true"
onMouseOut="window.status=' '; return true"  

href="http://servername/cgi-bin/ibi_cgi/webapi.dll?IBIF_ex=fexname&PARM1=VALUE1&PARM2=VALUE2&PARM3=VALUE3" 
 target="main" 
onClick="parent.banner.location='launchpagename.asp'">my report title</a>


ah..wait...Treasure of the Sierra Madre? no..no Blazing Saddles !

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




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 07, 2007, 04:18 PM
Leo L
Is this a self serve application? We do this all the time using the onload feature.
Which means, as soon as this frame finishes loading, it will automatically call the procedure in the second frame. This way, you can have it load the "default" report right away. Here you are also free to pass variables if you want as well.


we put this in the body tag.


ONLOAD="parent.Frame2.location='/ibi_apps/WFServlet?IBIF_ex=FEXPROGRAM'"

Hope this solves your problem

Leo
February 07, 2007, 04:26 PM
susannah
hmmm. nice , Leo!




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 07, 2007, 04:42 PM
Francis Mariani
I thought of the onLoad event trigger as well, but if the program that automatically runs comes back to the same screen, the user will not be able to change parameters and resubmit the report, because the onLoad will run again... (I think I'm explaining that correctly.)


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 07, 2007, 04:47 PM
Leo L
if I understand correctly, your saying the 2 frames "talk" to each other? And therefore an onload would cause a sort of "loop" one way?

In our system, we have the concept of 1 frame being the "selection" frame and the other frame being the "display" frame. So we really only need to send the information 1 way. The selection frame has all the options the user can choose, he hits submit and all that information is sent to the display frame.
The onload is then only loaded once (which is the first time the selection frame is loaded).

Leo


Prod: WebFOCUS 7.6.4 - Self Service - Windows Server2003 - Apache Tomcat 5.5
Dev: WebFOCUS 7.6.4 - Self Service - Windows XP SP2 - Apache Tomcat 5.5
February 07, 2007, 04:48 PM
<JJI>
Wilky,

Leo is right it's that simple. Or you can do it also like this with a java script:

<script LANGUAGE="JavaScript">
< !--
function loadmenu() {
IBI_random=Math.random()*Math.random()*Math.random()*100 ;
loadurl="http://127.0.0.1/cgi-bin/ibi_cgi/ibiweb.exe?IBIF_ex=fhsubmen&IBI_random="+IBI_random
parent.frames[1].location.href=loadurl

}
// -->

Then in the Body tag code: onload="loadmenu()"

Have fun Smiler
February 07, 2007, 04:51 PM
Wilky
susannah: We Dont need no Stinking Badges Good One

Francis Your are correct in that it does run the report, but half of the parms that do a lookup don't work and no buttons work. Frowner


PROD: WF 7.1.3 on Win 2003/IIS 6/Self-Serve & MRE
TEST: We dont need no Stinking Test Server!
February 07, 2007, 04:59 PM
Leo L
Do you only have 1 frame in your html page which the button and "report" are both showing in the same page?


Prod: WebFOCUS 7.6.4 - Self Service - Windows Server2003 - Apache Tomcat 5.5
Dev: WebFOCUS 7.6.4 - Self Service - Windows XP SP2 - Apache Tomcat 5.5
February 07, 2007, 05:00 PM
Wilky
Yes there is only 1 frame!

There is a button with 2 selection drop downs.

when the user clicks the button the report runs in the frame below the selection criteria and button.


PROD: WF 7.1.3 on Win 2003/IIS 6/Self-Serve & MRE
TEST: We dont need no Stinking Test Server!
February 07, 2007, 05:12 PM
Leo L
quote:
the report runs in the frame below the selection criteria and button


So if I understand correctly, When the user hits the "button" the form then calls a fex program which then replaces the frame with a new page that contains the drop downs, the button and the report?

Also, you said in an earlier response that the report does run but half the parms lookup don't work? Could it be that you are not passing the variables in the call?


Prod: WebFOCUS 7.6.4 - Self Service - Windows Server2003 - Apache Tomcat 5.5
Dev: WebFOCUS 7.6.4 - Self Service - Windows XP SP2 - Apache Tomcat 5.5
February 07, 2007, 05:13 PM
Francis Mariani
You say there is only one frame, but then you mention the report runs "in the frame below". Is this an iFrame?

The Submit button must do more than just Submit, it must be running some JavaScript as well. The onLoad must do everything that the Submit button does.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 08, 2007, 08:39 AM
mgrackin
quote:
Originally posted by susannah:
we donneedno steeenkeeeng test server..
i like that!
i can't rememeber the movie.

ah..wait...Treasure of the Sierra Madre? no..no Blazing Saddles !


Susannah,

Depending on how old you are will determine which movie you remember this from. I saw Sierra Madre long after I saw Blazing Saddles and did not realize that quote was originally from Sierra Madre until I saw it.

There is also one more pun of this line in the movie Ace Ventura: Pet Detective (the first one) in which a character says "We don't need no stinkin badgers" (meaning the animal).

By the way, I got a laugh out of the TEST SERVER statement too. We might all be FOCUS geeks but we still have a sense of humor!


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011