Displaying a Report on the Default WebFOCUS Page

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.


Top of page

x
Procedure: How to Display a Dynamic Report on the Default WebFOCUS Page
  1. Create a procedure that generates a dynamic report.
  2. Create a launch page from which a user can run the report.
  3. Run the report from the launch page. WebFOCUS returns the report to the browser as a complete HTML file. You can view it using browser options, for example, View/Source in Microsoft Internet Explorer.


Example: Displaying a Dynamic Report on the Default WebFOCUS Page

Note: For information on where to store the files created in this example, see Defining and Allocating WebFOCUS Files.

  1. Create a procedure named STATEINV, which generates a dynamic report. This report must be accessible to the WebFOCUS Reporting Server.

    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
  2. Create a launch page from which a user can run the report. The following is a simple launch page named RUNDYNAM. It uses the WebFOCUS Servlet:

    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>
  3. Run the launch page, and click the link. The dynamic report displays in the browser on the default WebFOCUS page:


Top of page

x
Procedure: How to Display a Static Report on the Default WebFOCUS Page
  1. Create a procedure:
    1. Identify the HTML file that will contain the report output and save it to the designated location. For example, on Windows, use a FILEDEF command. See Defining and Allocating WebFOCUS Files for details on platform-specific commands.

      The web server must be able to locate the file for browser display, so specify a location under a web server alias.

    2. Include the following command
      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.

  2. Run the procedure to create the report as an HTML file. There are several ways to do this, including:
    • Call the WebFOCUS Client. For an example, see Displaying a Static Report on the Default WebFOCUS Page.
    • Schedule the report to run with the WebFOCUS ReportCaster. See your ReportCaster documentation for details.
    • In WebFOCUS, access the following default directory

      Windows: install_drive:\ibi\srv80\wfs\bin

      UNIX: /ibi/srv80/wfs/bin

      z/OS: /ibi/srv80/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
  3. Create a launch page with a hyperlink that links to the report.


Example: Displaying a Static Report on the Default WebFOCUS Page

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.

  1. Create a procedure that saves a report as an HTML file. The following sample procedure is named STATDATA. The letters on the left correspond to the notes explaining the code.

    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
    1. This command allocates the file STATRPT and saves it to a designated directory.
    2. This command saves the report output as an HTML file named STATRPT.HTM.
  2. Run the procedure STATDATA to create and save STATRPT. One way to do this is to call the WebFOCUS Client.

    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.

  3. Create a launch page from which a user can run the report. The following is a simple launch page named STATIC:
    <HTML>
    <BODY>
    <A HREF="STATRPT.HTM">Click here to view the Orders Summary report</A>
    </BODY>
    </HTML>
  4. Run the launch page, and click the link. The static report displays in the browser on the default WebFOCUS page on which it was saved:


WebFOCUS