Controlling Multiple Reports

How to:

Reference:

WebFOCUS Client variables give you control over the display of multiple reports on the same HTML page with multiple frames without coding HTML FRAME syntax. It also allows you to link multiple reports with a single Table of Contents (TOC) that calls them. For example, you can use these variables to display different report formats, such as HTML and PDF, on a single launch page.

Note:

You can:

Use the variables described in this topic with procedures that generate more than one report. See Managing Flow of Control in an Application for details on the use of -RUN,  -INCLUDE, and EX to code multiple report requests.

WebFOCUS Client variables apply to WebFOCUS. Developer Studio does not support multiple reports generated by these variables. Instead, multiple reports can be created with the Developer Studio HTML Composer. These reports must be run in WebFOCUS.


Top of page

x
Reference: Formats of Multiple Reports

Two formats of multiple reports are supported:


Top of page

x
Reference: WebFOCUS Client Variables

The following are the variables that control multiple reports.

IBIWF_mreports

Controls the multiple report option and creates either a TOC or a frameset with one report for each frame in the browser.

The syntax is

IBIWF_mreports = {OFF|INDEX|FRAME}
IBIWF_mrcolumns = {1|n}
IBIWF_mrrows = nIBIWF_mprefix = {Report|text}
IBIWF_morder = {FORWARD|REVERSE}
IBIWF_mframename = {MREPORT|text}
IBIWF_index = {ON|OFF}

where:

OFF

Disables the multiple report option. OFF is the default value.

INDEX

Creates a TOC that lists all reports in a procedure. Default sequence numbers are from 1 (for the first report generated) to n (for the last report generated). Used with IBIWF_mprefix.

FRAME

Creates a default frameset. The number of reports in the frameset is determined by the IBIWF_mrcolumns variable.

IBIWF_mrcolumns

Is the number of side-by-side reports from left to right across the page when IBIWF_mreports is set to FRAME. If this variable is not set, reports are displayed top to bottom.

The syntax is

IBIWF_mrcolumns = {1|n}

where:

n

Is the number of reports. The default value is 1. The maximum value is 9.

IBIWF_mrrows

Is the number of vertically stacked reports when IBIWF_mreports is set to FRAME.

The syntax is

IBIWF_mrrows = n

where:

n

Is the number of reports desired from top to bottom.

IBIWF_mprefix

Is descriptive text that precedes a sequence number and identifies a report on a TOC.

WebFOCUS appends the number 1 (for the first report generated) to n (for the last report generated), as set by the index value on IBIWF_mreports.

Do not use this variable if IBIWF_mreports = FRAME.

The syntax is

IBIWF_mprefix = {Report|text}

where:

text

Is a character string, up to 50 characters long. The maximum length does not include the number appended by WebFOCUS. The default value is Report.

IBIWF_morder

Is the order in which reports display in the browser. Applies only when IBIWF_mreports = FRAME. Ignored when IBIWF_mreports = INDEX.

The syntax is

IBIWF_morder = {FORWARD|REVERSE}

where:

FORWARD

Displays reports in the order in which they were coded and executed. This value is the default.

REVERSE

Displays reports in the reverse order in which they were coded and executed. This is especially useful if the last report is a summary report you would like to display on the webpage first.

IBIWF_mframename

Is a name for a frame when IBIWF_mreports = FRAME. If you do not code this variable, WebFOCUS internally names the frames MREPORT1 through MREPORTn, which may conflict with other HTML code.

The syntax is

IBIWF_mframename = {MREPORT|text}

where:

text

Is a character string, up to 20 characters long.

IBIWF_index

Controls whether a sequence number (1, 2,...n) is appended to the end of the names on the TOC when IBIWF_mreports = INDEX.

The syntax is

IBIWF_index = {ON|OFF}

where:

ON

Appends a sequence number of 1 (for the first report generated) to n (for the last reported generated). ON is the default value.

OFF

Omits a sequence number. Only the text specified by IBIWF_mprefix applies.


Top of page

x
Syntax: How to Control Multiple Reports From a Hyperlink
<A HREF="/alias/WFServlet?IBIF_ex=report1[&var=value[&var=value]...]"> text</A>
<A HREF="/alias/WFServlet?IBIF_ex=report2[&var=value[&var=value]...]"> text</A>

where:

alias

Points to the directory in which the WebFOCUS Client is located. An application or web server uses an alias to provide a logical name for a physical directory. The WebFOCUS default alias is ibi_apps. It is customizable during the WebFOCUS Client installation from which it is then configured..

To call WebFOCUS on another web server, specify a fully qualified URL that includes the server name and port of the application or web server, For example

<A HREF="http://servername:port/alias/WFServlet?IBIF_ex=report1[&var=value[&var=value]...]"> text</A>
<A HREF="http://servername:port/alias/WFServlet?IBIF_ex=report2[&var=value[&var=value]...]"> text</A>
servername

Is the name of the application or web server on which WebFOCUS is installed.

port

Is the port on which the server is listening

report1,report2

Is the name of the procedure to run.

var=value

Is a WebFOCUS Client variable and its corresponding value.

You can pass more than one variable-value pair, but do not include a space between pairs. Use an ampersand (&) as a delimiter to separate each variable-value pair. A value can be a maximum of 80 characters long.

If a value contains an embedded blank, substitute a plus sign (+) or the characters %20 for the blank.

For a list of variables and valid values, see WebFOCUS Client Variables.

text

Is the text on the launch page that serves as the hyperlink that runs the procedure.



Example: Displaying Two Reports With an Index Value

The following is an example of displaying two reports with an index value.

  1. Create a procedure named TWORPTS, which consists of two requests. The first generates a report on total dollar sales; the second, on total unit and dollar sales.

    Procedure:

    TABLE FILE GGSALES
    SUM DOLLARS BY PRODUCT
    ON TABLE SET PAGE-NUM OFF
    ON TABLE SET STYLE *
    TYPE=REPORT, GRID=OFF,$
    ENDSTYLE
    END
    -RUN
    TABLE FILE GGSALES
    SUM UNITS DOLLARS BY PRODUCT
    ON TABLE SET PAGE-NUM OFF
    ON TABLE SET STYLE *
    TYPE=REPORT, GRID=OFF,$
    ENDSTYLE
    END
    -RUN
  2. Create a launch page named TWOLNCH. It contains a hyperlink that calls the WebFOCUS Servlet and passes it the name of the procedure to run. It also sets the variables that provide an identifier (Sales Analysis Report) and sequence number (1 and 2) to each report.

    Launch Page:

    <HTML>
    <BODY>
    <A HREF="/ibi_apps/WFServlet?IBIF_ex=tworpts 
    &IBIWF_mreports=index&IBIWF_mprefix=Sales+Analysis+Report">
    Run report.</A>
    </BODY>
    </HTML>
  3. Deploy the procedure and launch page using the Deploy Wizard.

    For more information, see Step 2: Create a Deployment Scenario located in the Creating Reporting Applications With Developer Studio manual.

  4. Run the launch page in the browser, and click Run report to receive the report on total dollar sales:

    Total dollar sales report diagram

    Click Sales Analysis Report 2 for the report on total unit and dollar sales:

    Total dollar sales report diagram


Top of page

x
Syntax: How to Control Multiple Reports From a Procedure
-TYPE WEBFOCUS CGIVAR var=value 
.
.
.
-RUN

where:

var=value

Is a WebFOCUS Client variable and its corresponding value. You can include only one variable-value pair per each -TYPE command.

For a list of variables and valid values, see WebFOCUS Client Variables.

Note: Include the command -RUN at the end of each request to execute the previous set of -TYPE commands.



Example: Displaying Side-By-Side Reports

The following is an example of displaying side-by-side reports.

  1. Create a procedure named SIDERPTS, which consists of two requests. The first generates a report on sales by store. The second generates a report on sales by product.

    -TYPE commands create a two-frame page on which the reports display side-by-side.

    Procedure:

    -TYPE WEBFOCUS CGIVAR IBIWF_mreports=FRAME
    -TYPE WEBFOCUS CGIVAR IBIWF_mrcolumns=2
    TABLE FILE CENTORD
    HEADING
    "Sales By Store"
    SUM LINEPRICE AS 'Sales'
    BY SNAME
    ON TABLE SET PAGE-NUM OFF
    ON TABLE SET STYLE *
    TYPE=REPORT, GRID=OFF,$
    ENDSTYLE
    END
    -RUN
    TABLE FILE CENTORD
    HEADING
    "Sales By Product"
    " "
    SUM LINEPRICE AS 'Sales'
    BY PRODCAT AS 'Product'
    ON TABLE SET PAGE-NUM OFF
    ON TABLE SET STYLE *
    TYPE=REPORT, GRID=OFF,$
    ENDSTYLE
    END
  2. Create a launch page that runs the procedure.
  3. Deploy the procedure and launch page using the Deploy Wizard.

    For more information, see Step 2: Create a Deployment Scenario located in the Creating Reporting Applications With Developer Studio manual.

  4. Access the launch page in the browser, and run the reports:

    Launch page browser diagram



Example: Displaying Two Reports With Descriptive Names and Sequence Numbers

The following is an example of displaying two reports with descriptive names and sequence numbers.

  1. Create a procedure named HTMPDF1, which consists of two requests. The first generates a report on total dollar sales in HTML format; the second, on total dollar sales in PDF format.

    -TYPE commands set the variables that provide an identifier (HTML Report and PDF Report) and sequence number (1 and 2) to each report. The command that creates the TOC is required only once at the beginning of the procedure.

    Procedure:

    -TYPE WEBFOCUS CGIVAR IBIWF_mreports=INDEX
    -TYPE WEBFOCUS CGIVAR IBIWF_mprefix=HTML Report
    TABLE FILE GGSALES
    SUM DOLLARS BY PRODUCT
    ON TABLE SET PAGE-NUM OFF
    ON TABLE SET STYLE *
    TYPE=REPORT, GRID=OFF,$
    ENDSTYLE
    END
    -RUN
    TABLE FILE GGSALES
    -TYPE WEBFOCUS CGIVAR IBIWF_mprefix=PDF Report
    SUM DOLLARS BY PRODUCT
    ON TABLE PCHOLD FORMAT PDF
    END
  2. Create a launch page that runs the procedure.
  3. Deploy the procedure and launch page using the Deploy Wizard.

    For more information, see Step 2: Create a Deployment Scenario located in the Creating Reporting Applications With Developer Studio manual.

  4. Run the launch page in the browser. The report in HTML format displays.

    HTML Format report diagram

  5. Click PDF Report 2 for the report in PDF using the Acrobat Reader.

    PDF report form diagram



Example: Displaying Two Reports With Descriptive Names Only

The following is an example of displaying two reports with descriptive names only.

  1. Create a procedure named HTMPDF2, which consists of two requests. The command -TYPE WEBFOCUS CGIVAR IBIWF_index=OFF omits sequence numbers from the names in the TOC.

    Procedure:

    -TYPE WEBFOCUS CGIVAR IBIWF_mreports=INDEX
    -TYPE WEBFOCUS CGIVAR IBIWF_index=OFF
    -TYPE WEBFOCUS CGIVAR IBIWF_mprefix=HTML Report
    TABLE FILE GGSALES
    SUM DOLLARS BY PRODUCT
    ON TABLE SET PAGE-NUM OFF
    ON TABLE SET STYLE *
    TYPE=REPORT, GRID=OFF,$
    ENDSTYLE
    END
    -RUN
    -TYPE WEBFOCUS CGIVAR IBIWF_mprefix=PDF Report
    TABLE FILE GGSALES
    SUM DOLLARS BY PRODUCT
    ON TABLE PCHOLD FORMAT PDF
    END
  2. Create a launch page that runs the procedure.
  3. Deploy the procedure and launch page using the Deploy Wizard.

    For more information, see Step 2: Create a Deployment Scenario located in the Creating Reporting Applications With Developer Studio manual.

  4. Run the launch page in the browser. The reports have descriptive names without sequence numbers.

    Descriptive names for reports diagram



Example: Displaying Two Reports With Sequence Numbers Only

The following is an example of displaying two reports with sequence numbers only.

  1. Create a procedure named HTMPDF3, which consists of two requests. The command -TYPE WEBFOCUS CGIVAR IBIWF_mprefix= omits descriptive names for the reports.
    -TYPE WEBFOCUS CGIVAR IBIWF_mreports=INDEX
    -TYPE WEBFOCUS CGIVAR IBIWF_mprefix=
    TABLE FILE GGSALES
    SUM DOLLARS BY PRODUCT
    ON TABLE SET PAGE-NUM OFF
    ON TABLE SET STYLE *
    TYPE=REPORT, GRID=OFF,$
    ENDSTYLE
    END
    -RUN
    TABLE FILE GGSALES
    SUM DOLLARS BY PRODUCT
    ON TABLE PCHOLD FORMAT PDF
    END
  2. Create a launch page that runs the procedure.
  3. Deploy the procedure and launch page using the Deploy Wizard.

    For more information, see Step 2: Create a Deployment Scenario located in the Creating Reporting Applications With Developer Studio manual.

  4. Run the launch page in the browser. The reports have sequence numbers without descriptive names:

    Launch page browser diagram


WebFOCUS