Forums
FOCUS/WebFOCUS
Is it possible to launch a 2nd IE session with a message in it?|
Go
![]() |
New
![]() |
Search
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Platinum Member |
Hi,
When we submit our reports to HMTL output or Excel output a new window is launched which the data will be displayed in. We would like to launch a second IE window with a message if the report has returned more than X number of rows. I have coded a check on &LINES at the end of the report, and if the requirement is met I wish to output the following: -HTMLFORM BEGIN Report ABC ran for more than X minutes. Please contact xxx. -HTMLFORM END However this does not create 2nd window, it just appends the message to the bottom of the report results. Is there any way to launch a 2nd window? WebFocus 5.3.5 AS400 |
||
|
|
Expert |
Here's one way to do it (Change the value of the DM variable &THRESHOLD to a number less than 5 or greater than 4 to see the difference in message/no message behaviour):
-SET &THRESHOLD = 3;
TABLE FILE CAR
SUM
SALES
BY COUNTRY
END
-RUN
-SET &NB_LINES = &LINES;
-SET &ONLOADFUNC = IF &NB_LINES GT &THRESHOLD THEN 'DisplayMsg1();' ELSE '';
-HTMLFORM BEGIN
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
function DisplayMsg1()
{
var vWinFeatures = "height=50,width=300,left=45,top=45,menubar=no,toolbar=no,status=yes,resizable=yes,scrollbars=yes";
winMsgWindow = window.open("","winMsgWindow", vWinFeatures);
winMsgWindow.document.writeln('the report has returned more than !IBI.AMP.THRESHOLD; number of rows');
}
</SCRIPT>
</HEAD>
<BODY onload="!IBI.AMP.ONLOADFUNC;">
</BODY>
</HTML>
-HTMLFORM END
Francis Env 1: WebFOCUS 5.3.2 Servlet - MRE/BID/Self Service/ReportCaster - MS Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server 2000 - DataMigrator 5.3.4 Env 2: WebFOCUS 7.6.5 Servlet - MRE/BID/Self Service - MS Windows XP SP2 - Apache Tomcat/5.5.25 - MS SQL Server 2000 Env 3: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2 Output formats: HTML, Excel 2000 and PDF |
|||
|
|
Platinum Member |
We too could use this simple, yet fine example Francis, Thank you.
And Thx to you too Mark, for asking the Q. Sandeep Mamidenna ------------------------------------------------------------------------------------------------- Blue Cross & Blue Shield of MS WF.764 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! |
|||
|
|
Expert |
After the second window is opened with the window.open JS, the html inside the new window can be as elaborate as you want, just add more document.writeln JS commands.
Francis Env 1: WebFOCUS 5.3.2 Servlet - MRE/BID/Self Service/ReportCaster - MS Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server 2000 - DataMigrator 5.3.4 Env 2: WebFOCUS 7.6.5 Servlet - MRE/BID/Self Service - MS Windows XP SP2 - Apache Tomcat/5.5.25 - MS SQL Server 2000 Env 3: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2 Output formats: HTML, Excel 2000 and PDF |
|||
|
|
Platinum Member |
Thanks Francis, that's great. However it only appears to work when the output is for HTML, when outputting to Excel or PDF, it does not launch the message window? Will this be possible?
At the end of all our reports, we make a call to a 'INCLUDE FINISH'. This program updates a log file with some runtime stats, such as endtime, rows returned etc. It is at the top of this program that I have placed your code. Does it need to be moved? Example: TABLE FILE ABC ... ... ... $ TYPE=ACROSSTITLE, SIZE=9, $ TYPE=GRANDTOTAL, BACKCOLOR=RGB(210 210 210), $ ENDSTYLE END -RUN -INCLUDE FINISH -EXIT -* File finish.fex
-HTMLFORM BEGIN
<HTML>
<HEAD>
<script language="JavaScript">
function DisplayMsg1()
{
var vWinFeatures = "height=50,width=300,left=45,top=45,menubar=no,toolbar=no,status=yes,resizable=yes,scrollbars=yes";
winMsgWindow = window.open("","winMsgWindow", vWinFeatures);
winMsgWindow.document.writeln('the report has returned more than !IBI.AMP.THRESHOLD; number of rows');
}
</SCRIPT>
</HEAD>
<BODY onload="!IBI.AMP.ONLOADFUNC;">
</BODY>
</HTML>
-HTMLFORM END
Many thanks Mark This message has been edited. Last edited by: mark66, WebFocus 5.3.5 AS400 |
|||
|
|
Expert |
mark, you need to put code tags around the html in your post, otherwise we can't read it all.
-s francis, applause. another T.O.T.Y. award! f, how would i get a window name on that little pop up? In an ordinary html page, i would use the <title>page title here </title>in the head section of the htmlform. I would like to give a nicer title to this pop up window than the default server name..etc. This message has been edited. Last edited by: susannah,
|
|||||
|
|
Platinum Member |
Susannah,
This works when you add the following line to Francis' script:
winMsgWindow.document.write('<HTML><TITLE>page title here</TITLE></HTML>');
Regards, Sean ------------------------------------------------------------------------ PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode |
|||
|
|
Master |
Here is what I would suggest. Using a combination of JavaScript and WebFOCUS code. Run the Report and hold it to a temp location that gets cleand up say after x number of hours. Then at the end of the report where you check &LINE if you want to open a message windows then put a button on it that says something like "Display Report" at which time you call and display the saved report file. else you just display the saved report file.
|
||||
|
|
Expert |
is that ever great! thanks Sean, and applause to all 3 of you.
|
|||||
|
|
Platinum Member |
Done Texas, that does sound like a good suggestion, but for the moment we still want to launch this second window if possible. I just need to know how to make it happen when outputting to a format other than HTML? WebFocus 5.3.5 AS400 |
|||
|
|
Master |
If you your output is HTML then you would have to use the code provided. If the output is EXCEL then you would have to use an excel template and code a macro to diaplsy a message. If the output is PDF I don't know what you would have to do it there is anything. My Suggestion above would work for what ever your output format is.
|
||||
|
|
Expert |
If you're able to grab the computername of the user ( i don't know how to do that..but there must be a way)
then CMD NET SEND computername YOUR MESSAGE HERE -RUN sends an alert box to the computername and can be sent mid-fex and doesn't involve an HTMLFORM effectively stopping the processing. You would issue it after your extract file and before your final file preparation (whatever format) Our network is cisco and our server win2k or win2k3, if that helps. I use this command with my own computername hardcoded in it to alert me to some things my users are doing. kinda sneaky.
|
|||||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|
Forums
FOCUS/WebFOCUS
Is it possible to launch a 2nd IE session with a message in it?
