[CASE] Customize 'WebFOCUS Report' Page Created With 'ON TABLE PCHOLD FORMAT EXL2K'
With the 'ON TABLE PCHOLD FORMAT EXL2K' TABLE command, WebFOCUS creates a 'WebFOCUS Report' page.
The code behind the page looks like this:
<HTML>
<Head>
<Title>WebFOCUS Report</Title>
<Script type="text/javascript" Language="JavaScript">
<!--
function getrep()
{
if(parseInt(window.navigator.appVersion,10)<4)
location.assign("/ibi_apps/WFServlet?PG_REQTYPE=REDIRECT&PG_MRsaved=false&PG_Func=GETBINARY&PG_File=wvedysyh.xmh");
else
location.replace("/ibi_apps/WFServlet?PG_REQTYPE=REDIRECT&PG_MRsaved=false&PG_Func=GETBINARY&PG_File=wvedysyh.xmh");
} //-->
</Script></Head>
<body onload="getrep()"></BODY>
</HTML><!--
0 NUMBER OF RECORDS IN TABLE= 1000 LINES= 1000
-->
The page that the user sees is 'blank'.
Is it possible to customize this page, with a friendly message? For example: 'Check your Excel application for your xyz report and close this window.'This message has been edited. Last edited by: Kerry,
Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
October 03, 2011, 05:12 PM
Waz
You can use &LINES to check to see if there are any records in the report, then branch to a report that shows the message.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
October 03, 2011, 05:24 PM
Francis Mariani
Waz, David would like something on that blank window when there IS data to display in Excel.
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
October 03, 2011, 05:35 PM
David Briars
Thank you for the clarification, Francis.
You are correct.
It is 'as if' I wanted to put 'Check your Excel application for...close this window', within the body tags of the page.
Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
October 03, 2011, 05:40 PM
Waz
Oops,
thats what happens after a long weekend, and not much sleep.
Sorry.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
October 03, 2011, 05:49 PM
Francis Mariani
quote:
Great Southern Land
- Is that a newly found Territory?
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
October 03, 2011, 06:17 PM
Waz
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
October 11, 2011, 09:24 AM
David Briars
If I can't write a 'user friendly' message to the automatic 'WebFOCUS Report' page, can I suppress its creation?
I've done a FocalPoint search, and found threads discussing this matter, but no thread that said definitively that suppression was or was not possible.
Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
October 11, 2011, 10:52 PM
ABT
here's what we do.
-SET &PGMNAME = 'some_name_here';
-* Include before the final hold
-***********************************
-SET &APPFILE = &PGMNAME||'.XLS';
APP FILEDEF &PGMNAME DISK LIBRARY/&APPFILE
-***********************************
TABLE FILE CAR
PRINT
*
ON TABLE HOLD AS &PGMNAME FORMAT EXL2K
END
-SET &FILENAME = LOCASE(10,&PGMNAME,&PGMNAME);
-SET &LINK = 'http://server:8080/approot/library/'||&FILENAME||'.xls';
-HTMLFORM BEGIN
<html> <head> <meta HTTP-EQUIV="REFRESH" content="0; url=&LINK"/> </head> <body> !IBI.FIL.REPORT; </body> </html>
I have opened up a case with IB on this issue, i.e., "Can 'WebFOCUS Report Page' be suppressed?". They have repro'd on their side, and have moved the case beyond front level support, for further review. I'll let everyone know how the case turns out.
ABT, your workaround looks good. I haven't had a chance to try it at my site, and will have time to try soon.
October 28, 2011, 10:07 AM
David Briars
Thread Update:
IB continues to work on the case. (I am guessing they are very busy, in that this case is taking so long.)
They have determined, per the case, that the Redirection Settings cannot suppress the rogue 'WebFOCUS Report' under Windows 7. They feel that this is a Microsoft issue and site Article ID: 927009: http://support.microsoft.com/kb/927009
I have asked for a workaround, and they are working on this.
November 03, 2011, 11:46 AM
David Briars
Thread Update:
IB's HelpDesk assisted me with a HTML workaround, for suppressing the 'WebFOCUS Report' redirect window.
The 'submit form', on the report launch page now has an iframe. For an Excel report request, this iframe becomes the target of the form, and replaces the blank browser window.
Model/example follows:
launch.fex
-*
-* Set up environment.
-*
-DEFAULTH &IBIMR_domain='MR Domain Name Not Available'
-TYPE Current MR Domain Name is: &IBIMR_domain
-SET &DOMAIN_NAME = &IBIMR_domain;
-SET &FOLDER_NAME = '#test';
-* Create a random number.
-SET &RANDOM = RDUNIF(D5) * RDUNIF(D5) * 10000;
-*
-* Present launch page to user.
-*
-HTMLFORM BEGIN
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title> GG Sales Report </title>
<meta http-equiv="CACHE-CONTROL" content="NO-CACHE">
-*
-* JavaScript source/code begins here:
-*
<script language=javascript>
//
// Initialize window properties global variable.
//
var WProps = new String("location=no,toolbar=no,directories=no");
WProps += ",scrollbars=yes,menubar=no";
WProps += ",status=no,resizable=yes,top=20,left=10,width=";
WProps += screen.availWidth - 50;
WProps += ",height=";
WProps += screen.availHeight - 80;
//
// Function: sub_form
// Purpose : Call WebFOCUS, to run report.
//
function sub_form() {
// Pull selected Output.
var myindex = document.Form1.selST.selectedIndex;
var myvalue = document.Form1.selST.options[myindex].value;
document.hiddenRunForm.ST.value = myvalue;
// Pull selected Output.
var myindex = document.Form1.selFMT.selectedIndex;
var myvalue = document.Form1.selFMT.options[myindex].value;
document.hiddenRunForm.FMT.value = myvalue;
if (document.hiddenRunForm.FMT.value == 'EXL2K') {
document.hiddenRunForm.target = "ifrmExcel";
} else {
document.hiddenRunForm.target = "report_launch";
// Open the pop up window with a blank page.
rptWindow = window.open("", document.hiddenRunForm.target, WProps);
// Place 'waiting' message in the new window.
var content = new String();
content = '<FONT face="Calibri" size="+1" color="black">';
content += "Your report will be ready shortly. <br>";
content += "Just a moment, please..";
content += "</FONT>";
content += " ";
rptWindow.document.open();
rptWindow.document.write(content);
rptWindow.document.close();
}
// Run the WF report.
document.hiddenRunForm.submit();
}
</script>
</head>
-*
-* Body of Launch Page.
-*
<body>
<form name=Form1 id=Form1>
Select State:
<select name="selST">
<option value="TX">Texas</option>
<option value="IL">Illinois</option>
</select>
<br><br>
Select Format:
<select name="selFMT">
<option value="AHTML">Active</option>
<option value="EXL2K">Excel 2000</option>
<option value="HTMTABLE">Web Page</option>
</select>
<br><br>
-*
-* Control Buttons.
-*
<input value="Run Report" type="button" onClick="sub_form();" />
</form>
-*
-* Hidden Form, submitted to WebFOCUS to run report.
-*
<form name="hiddenRunForm" id="hiddenRunForm" style="visibility:hidden;"
action="/ibi_apps/WFServlet"
method="post" target="">
-*
-* Variables passed from web page to WebFOCUS servlet.
-* -WebFOCUS related variables.
-*
<input type="hidden" name="IBIMR_domain" value="!IBI.AMP.DOMAIN_NAME;">
<input type="hidden" name="IBIMR_action" value="MR_RUN_FEX">
<input type="hidden" name="IBIMR_sub_action" value="MR_STD_REPORT">
<input type="hidden" name="IBIMR_fex" value="app/report.fex">
<input type="hidden" name="IBIF_fex" value="app/report.fex">
<input type="hidden" name="IBIMR_folder" value="!IBI.AMP.FOLDER_NAME;">
<input type="hidden" name="IBIMR_random" value="!IBI.AMP.RANDOM;">
<input type="hidden" name="IBIMR_flags" value="">
<input type="hidden" name="IBIMR_drill" value="RUNNID">
-*
-* Variables passed from web page to WebFOCUS servlet.
-* -Report related variables.
-*
<input type="hidden" name="FMT">
<input type="hidden" name="ST">
-*
<iframe style="POSITION: absolute; DISPLAY: none;"
id=iframe1 tabIndex=2
autoExecute="False"
name="ifrmExcel">
</iframe>
</form>
</body>
</html>
-HTMLFORM END
report.fex
APP PREPENDPATH IBISAMP
-DEFAULTH &ST = 'TX'
-SET &HOLD_TYPE = IF &FMT EQ 'EXL2K' THEN 'PCHOLD' ELSE 'HOLD';
TABLE FILE GGSALES
PRINT *
IF ST EQ &ST
ON TABLE &HOLD_TYPE FORMAT &FMT
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<title>Sales Report</title>
</head>
<body>
!IBI.FIL.HOLD;
</form>
</body>
</html>
-HTMLFORM END
-EXIT
November 03, 2011, 12:43 PM
Francis Mariani
Interesting.
How would this work for a HTML Composer generated launch page, how do you change the target based on the output format on the fly? Using JavaScript?
Thanks for sharing this.
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
November 03, 2011, 01:12 PM
David Briars
quote:
how do you change the target based on the output format on the fly? Using JavaScript?
Correct, target changed on the fly using JavaScript: