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.
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
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
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.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !!
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006
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
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
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?
-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
MarkThis message has been edited. Last edited by: mark66,
WebFocus 765. iSeries v5r4
Posts: 175 | Location: England | Registered: April 11, 2006
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,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
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.
Originally posted by susannah: mark, you need to put code tags around the html in your post, otherwise we can't read it all...
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 765. iSeries v5r4
Posts: 175 | Location: England | Registered: April 11, 2006
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.
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.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003