As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I guess that everybody noticed, that there is one user interface isue in generating "highly computational" reports - user must wait for it and there is no message telling about it (like "report is generating ....please wait... be patient - don't press refresh button " )
is it posible to make report preloader before displaying returned report? Maybe, there is an excelent example of it
This discussion contains the code you need to do the following steps.
The basic steps are as follows:
1) Create an HTML page (the CHILD page) that contains the "report is generating, please wait" message.
2) Change your submit button on your original HTML page (the PARENT page) to a normal button with an onclick method that opens a new browser window with the CHILD page in it.
3) Add an onload method to the CHILD page to trigger a submit of the form on the PARENT page.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
I had a similar requirement just before the holiday period (PC to the end ) and produced a screen with a progress bar showing on it. The progress bar is not entirely acurate (you have to guesstimate the time to load ) but at the very least it warns the user that the report is a time consuming one and that they should be patient (yeah, right!).
This works for both MRE and self service.
Place the following code snippets into your HTML page with either the self service of MRE code as required.
<body onload="Subm();CallJS('Demo()');">
.
. more code here
.
<br /><br />
Loading data .....<br /><br />
Please wait ....<br />
<form name="form" action="/cgi-bin/ibi_cgi/ibiweb.exe" method="post">
-*<INPUT type=hidden value=mrehtml/mrehtml.htm name ="IBIMR_domain">
-*<INPUT type=hidden value=app/fexname.fex name ="IBIMR_fex">
-*<INPUT type=hidden value=MR_RUN_FEX name ="IBIMR_action">
-*<INPUT type=hidden value=MR_STD_REPORT name ="IBIMR_sub_action">
-*<INPUT type=hidden value=#mrefolderid name ="IBIMR_folder">
-*<INPUT type=hidden value=14:47:56 name ="IBIMR_random">
-*<INPUT type=hidden name ="IBIAPP_app" ismre="1">
<INPUT id=IBIF_ex name=IBIF_ex type=hidden value=fexname>
<INPUT id=IBIAPP_app name=IBIAPP_app type=hidden value=appname>
</form>
You can see that upon loading the HTML page calls two javascript functions, the first just performs a "document.form.submit();" and kicks off the execution of the fex. The second sets up a timer and shows a variable length bar according to a timer value. I found the basic javascript for this on a free JS website and modified it slightly for my needs. The needs to be placed within your HEAD tags -
<style>
<!--
.hide { position:absolute; visibility:hidden; }
.show { position:absolute; visibility:visible; }
-->
</style>
<script language="JavaScript">
var duration=18 // Specify duration of progress bar in seconds
var _progressWidth = 75; // Display width of progress bar
var _progressBar = new String("
");
var _progressEnd = 10;
var _progressAt = 0;
// Create and display the progress dialog.
// end: The number of steps to completion
function ProgressCreate(end) {
// Initialize state variables
_progressEnd = end;
_progressAt = 0;
// Move layer to center of window to show
if (document.all) { // Internet Explorer
progress.className = 'show';
progress.style.left = (document.body.clientWidth/2) - (progress.offsetWidth/2);
progress.style.top = document.body.scrollTop+(document.body.clientHeight/2) -
(progress.offsetHeight/2);
} else if (document.layers) { // Netscape
document.progress.visibility = true;
document.progress.left = (window.innerWidth/2) - 100;
document.progress.top = pageYOffset+(window.innerHeight/2) - 40;
} else if (document.getElementById) { // Netscape 6+
document.getElementById("progress").className = 'show';
document.getElementById("progress").style.left = (window.innerWidth/2)- 100;
document.getElementById("progress").style.top = pageYOffset+(window.innerHeight/2) - 40;
}
ProgressUpdate(); // Initialize bar
}
// Hide the progress layer
function ProgressDestroy() {
// Move off screen to hide
if (document.all) { // Internet Explorer
progress.className = 'hide';
} else if (document.layers) { // Netscape
document.progress.visibility = false;
} else if (document.getElementById) { // Netscape 6+
document.getElementById("progress").className = 'hide';
}
}
// Increment the progress dialog one step
function ProgressStepIt() {
_progressAt++;
if(_progressAt > _progressEnd) _progressAt = _progressAt % _progressEnd;
ProgressUpdate();
}
// Update the progress dialog with the current state
function ProgressUpdate() {
var n = (_progressWidth / _progressEnd) * _progressAt;
if (document.all) { // Internet Explorer
var bar = dialog.bar;
} else if (document.layers) { // Netscape
var bar = document.layers["progress"].document.forms["dialog"].bar;
n = n * 0.55; // characters are larger
} else if (document.getElementById){
var bar=document.dialog.bar
}
var temp = _progressBar.substring(0, n);
bar.value = temp;
}
// Demonstrate a use of the progress dialog.
function Demo() {
ProgressCreate(15);
window.setTimeout("Click()", 100);
}
function Click() {
if(_progressAt >= _progressEnd) {
ProgressDestroy();
return;
}
ProgressStepIt();
window.setTimeout("Click()", (duration-1)*1000/10);
}
function CallJS(jsStr) { //v2.0
return eval(jsStr)
}
</script>
<script language="JavaScript">
// Create layer for progress dialog
document.write("<span id=\"progress\" class=\"hide\">");
document.write("<FORM name=dialog>");
document.write("<TABLE border=2 bgcolor=\"#FFFFCC\">");
document.write("<TR><TD ALIGN=\"center\">");
document.write("Progress<BR>");
document.write("<input type=text name=\"bar\" size=\"" + _progressWidth/2 + "\"");
if(document.all||document.getElementById) // Microsoft, NS6
document.write(" bar.style=\"color:navy;\">");
else // Netscape
document.write(">");
document.write("</TD></TR>");
document.write("</TABLE>");
document.write("</FORM>");
document.write("</span>");
ProgressDestroy(); // Hides
</script>
The only item that needs to be changed is the value for "duration" which is set to 18 above and represents 18 seconds. Just approximate your reports runtime and substitute.
Enjoy
TThis message has been edited. Last edited by: Kerry,
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
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
Here is some sample code using the CAR file. Sorry for the multiple posts. I tried to correct my first post and messedit up, deleted it and now am reposting.
This is the PARENT page code:
<html> <head> <title> Do you feel Lucky? </title> </head> <script> function runit() { rptwindow=window.open("msgpage.htm","childwindow","toolbar=no,location=no,status=no,menubar=yes, scrollbars=yes,width=750,height=500,left=1,top=1,resizable=yes"); } </script> <body> You gotta ask yourself, "Do I feel Lucky?"
Go ahead, make my day. Click the button. <form name="theform" method="post" action="/cgi-bin/ibi_cgi/webapi.dll" target="childwindow"> Please pick one:
<input type="hidden" name="IBIF_ex" value="carfex1"> <select name="COUNTRY"> <option value="ENGLAND">I'm from ENGLAND</option> <option value="FRANCE">I'm from FRANCE</option> <option value="ITALY">I'm from ITALY</option> <option value="JAPAN">I'm from JAPAN</option> <option value="W GERMANY">I'm from W GERMANY</option> </select>
<html> <head> <title> Reporting is generating...Please wait. </title> </head> <body onload="window.opener.document.theform.submit[);"> Reporting is generating...Please wait. </body> </html>
This is the FOCEXEC that is executed:
TABLE FILE CAR HEADING "You may pick one of the following cars:" PRINT COUNTRY CAR MODEL BODYTYPE WHERE COUNTRY EQ '&COUNTRY' ENDThis message has been edited. Last edited by: mgrackin,
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
It is a box and that is so that it looks like a bar - nothing more complex than that! You could use a right carat ">" if you wanted - or any other character.
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
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
Tony A, your sugestion is wat I was trying to do before posting a post ..some modifications to my previuos javascript code and I am ready to go!!
Basicaly the "popup version" is the same as Tonys's, just "popup version" uses popup windows (am not sure that everybody like them ...and popup window leaves opened-additional user interaction is needed to close it ...another issue - popup blockers )
p.s. maybe sometimes it is usefull to put an image with animation like progressbar (like yahoo does this then uploading attachments)
thanks T, what is the & character code string that produces the box? i remember posting the site where we can look all that up, but i can't find the post. argh. ah..never mind.. its & # 127 .. i cheated and copypasted and looked at it.. voila
Motiejus..would you be kind enough to post your final, tweaked, javascript? That would be so appreciated. thanks. I agree with you about popups or alert boxes..not my favourite alternative, either.This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Firstly, when I invoked fex I used a direct link to execute the fex, so, several times, the load time was high, so I did a fex called "preloadest.fex" wich contains a little html where I put an animated gif and a META TAG to refresh the content when it was loaded, the code is:
That's neat and compact - guess I might be changing.
I could set up some javascript on launch screens to check to see if certain combo boxes have ALL selected and redirect the IBIF_ex to the "Please wait" screen accordingly!
Thanks Ruben
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
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
T.. can you help me translate Ruben's code CONTENT="2;URL=!IBI.GLB.IBEPGM; what should the ibi.glb.ibepgm be? thanks. Ruben, very cool. i had to omit the -set &='&' line. AH..i figured it out here's what works for me, using Ruben's cool technique CONTENT="2;URL=http://grwf01/cgi-bin/ibi_cgi/webapi.dll?IBIF_ex=myfex&|MYPARM=SOMEVALUE&|MYPAR2=SOMEVALUE2"> when i pass parms, i use the escape character, |, and i changed the timing delay to 0 seconds, and whats nice is that the wait page stays on the screen as long as it needs to, until the report is ready. and here's an idea...the gif could be animated.. so your user could be confident that the fex was still running...if you've got a longer running one. Very cool, Ruben. What does 'Cargando datos' mean? ah i googled it..."loading data". of course! Ruben, did you write the site for the Universidad de la Serena?This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Don't know if you know it, but you can dafine a var in the WebFOCUS' console, in the edasprof file, in my case, I created a var to simplify writing long url, and also, choose if I want to execute cgi or servlet, so the vars to be executed in fex must be globals:
By the way, the 2 in the CONTENT is a delay timer in seconds that will be applied to the refresh request. This allows the browser time to load the gif before beginning the fex execution. Change it to the number of seconds delay you want. If your retrieval of gifs is superbly fast then 1 might be OK.
T.This message has been edited. Last edited by: Tony A,
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
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
I was inspired by Ruben's excellent suggestions to find out if there's a more automatic way to set the cgi/servlet parameter.
If you add the following to the Custom Settings, you will have the correct cgi/servlet in a parameter:
CGI_PROG (pass)
The result is that a DM variable, &CGI_PROG exists with this value: /ibi_apps/WFServlet. The appropriate directory/program would be set if the Server was set up for CGI.
To access the Custom Settings:
• Open the WebFOCUS Administration Console - URL: http://web-server-name/ibi_html/wfconsole.htm • Login with the appropriate WebFOCUS Administration User ID • Click on Configuration • Click on Custom Settings
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
Hi, I understand what we are doing here but my question is, this preload.fex is common for all fex (or) for each fex we need to have one preload.fex.
Because this preload.fex expects which fex to run. The other thing is the parameter getting from UI screen to the main fex. How we can customize this? If I miss something, Please let me know.
Any help in this will be great.
Thanks Kamesh
Posts: 780 | Location: Florida | Registered: January 09, 2005
you'ld have to write one for each fex if you pass parms; if you don't pass any parms , then you might be able to get away with one preload which takes the fexname as a parm from the launch page.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
T, yes, agreed. fexname could pass as a parm to a single preloader, but if the fex itself took parms, and each fex you might want to run took different parms and a different number of them, it might be easier and cleaner to write a preloader for each fex... and i'm going to do a different preload image for each fex anyway...just because i'm such an arteeest my syntax is: fexname0 is the preloader of fexname1 Francis, i tried it. Cute! that is a very nice gift of the week!This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
I'm just curious if the version of this technique I posted was helpful? I ask because (if I am reading correctly) it seems that you are going through hoops to get the necessary variables onto the preloader page to then send it off to WebFOCUS for execution. The technique I posted does not require doing any of this because it triggers a Submit for the form on the parent page which contains all the variable values. Because of this, nothing needs to be populated on the Child page AND this technique will work for ANY FOCEXEC that is called.
Would this help or is it just not feasible to adopt the technique I posted because of the use of MRE? The code I posted was for self-serve and have never tried to adopt it for MRE.
I was just curious since this topic is still going.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
Its a different approach, Mickey, its seems. opening a new window, and very nicely so. Ruben's approach replaces the existing window with new content... with a redirect...which works from both mre or ss.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
I have used Ruben's technique sucessfully for a single process. I am now trying to use it for sequential processes, but I am not having any luck. I can run each individually {&ENTITY='SUB1' or &ENTITY='SUB2' } and it they each work, but if I select to run both {&ENTITY='ALL'} then It shows the "wait" screen for both processes immediately and only completes the first process. Any help on how to make this work would be appreciated. Code is below:
This message has been edited. Last edited by: Matthew,
PROD: WebFOCUS 7.1.4 on Win 2003/Microsoft-IIS 6.0/ServletExec 4.2/JAVA version 1.5.0_09 DEV: WebFOCUS 7.6.1 on Win 2003/Microsoft-IIS 6.0/ServletExec 4.2/JAVA version 1.5.0_09 LOCAL: WebFOCUS 7.6.2 on Win XP SP2/Apache Tomcat 5.5.17/JAVA version 1.5.0_09
Posts: 31 | Location: Denver | Registered: April 11, 2005