Focal Point
[CLOSED] executing multiple .fex's from within one fex

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

December 01, 2011, 10:57 AM
Ted Michalski
[CLOSED] executing multiple .fex's from within one fex
How can I code a single fex whereby I execute multiple fex's in succession getting separate pdf's (one for each fex)?

This message has been edited. Last edited by: Ted Michalski,


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
December 01, 2011, 11:20 AM
Prarie
Do some research on -INCLUDE
December 01, 2011, 11:27 AM
njsden
If what you expect is to run the report and get each independent PDF in the client's browser via PCHOLD that is not possible. Well, you cannot really open multiple PDF files in the same browser anyway and there is no way (that I know of) that would trigger multiple browser windows upon receiving results from the WebFOCUS client.

You could however create those PDF files in your server and implement other means to access them.

-INCLUDE rpt1.fex
-INCLUDE rpt2.fex
...
-INCLUDE rptn.fex



Each "rpt#.fex" would do something like:

APP HOLD rpt_dest
TABLE FILE blah
PRINT stuff
ON TABLE HOLD AS HRPTn FORMAT PDF



Or you could use COMPOUND but again you want separate reports so that won't do.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
December 01, 2011, 02:04 PM
Dgraff
You could try playing with some js to open the various PDF reports in a new window. I use the below code to call drilldowns and still have the master rewport displayed in a window.
<html>
<head>
<title>Drilldown Report</title>
<script language="JavaScript">

var idx = document.URL.indexOf('?'); /* parameters on this URL? */
var params = new Array(); /* define an array */

if (idx != -1) /* if any params detected */
{
  /* split all the parameters as deliniated by an "&" */
  var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
  /* go through all parameters detected */
  for (var i=0; i<pairs.length; i++)
  {
    /* grab the variable and the value */
    nameVal = pairs[i].split('=');
  eval("V_"+" = new ParmResult(nameVal[0], nameVal[1]);");
  params[eval(params.length)] = eval("V_");
  }
}

function Request(parmname)
{
  if (params.length > 0)
  {
    for (i=0; i < params.length; i++)
    {
      if(params[i].name == parmname)
      {
        return params[i].val
      }
    }
  }
return null
}

function ParmResult(name, val)
{
  this.name = name;
  this.val = val;
}
</script>
</head>
<body>
<script language="JavaScript">
var cmd="/ibi_apps/WFServlet?IBIF_ex=fexname  &COLUMN=" + Request("COLUMN") + "&STRDTE=" + Request("STRDTE") + "&ENDDTE=" + Request("ENDDTE") + "&CLASS=" + Request("CLASS") + "&RPTFMT=" + Request("RPTFMT");
window.open(cmd,"");
history.back();
</script>
</body>
</html>
  



Duane

WebFOCUS 8.0.7
DS 8.0.7 AS 8.0.7
Windows
Output: Excel, HTML, PDF, AHTML,Mobile
In Focus 1982
December 02, 2011, 03:15 AM
GamP
Or, hold the PDF's ina place reachable by the webserver and as a result of the fex show a page with links to the created PDF's.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
December 02, 2011, 10:17 AM
MathematicalRob
Have you tried the "Table of Contents" option? You can find information
on that by searching the WebFocus help for "TOC". Here's an example:

-TYPE WEBFOCUS CGIVAR IBIWF_mreports=INDEX
-TYPE WEBFOCUS CGIVAR IBIWF_index=OFF
-TYPE WEBFOCUS CGIVAR IBIWF_mprefix=Car Report
TABLE FILE CAR
PRINT CAR
BY COUNTRY
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9,$
TYPE=DATA, COLUMN=1, WRAP=2,$
TYPE=DATA, COLUMN=2, WRAP=2,$
$
ENDSTYLE
END
-RUN
-************************************************
-TYPE WEBFOCUS CGIVAR IBIWF_mprefix=Model Report
TABLE FILE CAR
PRINT MODEL
BY CAR
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT, GRID=OFF, FONT='ARIAL', SIZE=9,$
TYPE=DATA, COLUMN=1, WRAP=2,$
TYPE=DATA, COLUMN=2, WRAP=2,$
$
ENDSTYLE
END


Rob


WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.