How to: |
The simplest way to display a report is to use the default WebFOCUS page. You do not need to design the page on which the report will appear. WebFOCUS automatically generates an HTML page that contains the necessary tagging. The report output is formatted on the page using the HTML <TABLE tag.
The following image shows a report displayed on the default WebFOCUS page.
If you save the output from a dynamic report using the command ON TABLE HOLD FORMAT HTML in a procedure, you create a static report, which can be called and displayed.
In applications where users do not require real-time information, static reports can substantially reduce overhead on the system. Reports can then be refreshed during off-peak times.
Note: For information on where to store the files created in this example, see Defining and Allocating WebFOCUS Files.
Procedure: STATEINV.FEX
SET PAGE-NUM = OFF TABLE FILE CENTORD SUM QTY_IN_STOCK BY PRODNAME ON TABLE SUBHEAD "INVENTORY REPORT FOR CALIFORNIA eMART STORES" WHERE STATE EQ 'CA' WHERE STORENAME EQ 'eMart' END
Launch Page: RUNDYNAM.HTM
<HTML> <BODY> <A HREF="http://server1/servlet/WFServlet?IBIF_ex=stateinv">Click here to run an inventory report for eMart in California.</A> </BODY> </HTML>
The web server must be able to locate the file for browser display, so specify a location under a web server alias.
ON TABLE HOLD FORMAT HTML AS report
where:
report is the name of a virtual file that contains the report output. The name can be from 1 to 8 characters. Do not include an extension. This file is not saved to disk.
Windows: install_drive:\ibi\srv82\wfs\bin
UNIX: /ibi/srv82/wfs/bin
z/OS: /ibi/srv82/wfs/bin
and issue the following command:
edastart -t
Execute the procedure from the WebFOCUS prompt >>:
ex procedure_name
To return to the WebFOCUS directory, type:
fin
This example runs on WebFOCUS for Windows. If you are using another platform, substitute the appropriate platform-specific command for the FILEDEF command. For details, see Defining and Allocating WebFOCUS Files.
Note: For information on where to store the files created in this example, see Defining and Allocating WebFOCUS Files.
Procedure: STATDATA.FEX
a. FILEDEF STATRPT DISK APP/STATRPT.HTM TABLE FILE GGORDER HEADING "Orders Summary" SUM QUANTITY AS 'Units Ordered' BY ORDER_DATE AS 'Order Date' BY PRODUCT_DESCRIPTION WHERE ORDER_DATE EQ '01/01/96' b. ON TABLE HOLD FORMAT HTML AS STATRPT END
The following simple HTML page uses the Servlet to run STATDATA. An administrator can use this kind of page to create the static reports that users will access.
<HTML> <BODY> <A HREF="/ibi_apps/WFServlet?IBIF_ex=statdata">Click here to run STATDATA and create a static report stored as STATRPT.HTM.</A> </BODY> </HTML>
WebFOCUS displays a message indicating that an HTML file was saved.
<HTML> <BODY> <A HREF="STATRPT.HTM">Click here to view the Orders Summary report</A> </BODY> </HTML>