Displaying a Report in a Helper Application

How to:

Reference:

A helper application or plug-in is a desktop program used by a browser to open a file with a format other than standard HTML. An example of a helper application is Adobe® Acrobat® Reader, which opens a PDF file.

When a web server sends a special type of file to a browser, it includes MIME (Multipurpose Internet Mail Extensions) information, indicating the file format. WebFOCUS determines which helper application to run based on MIME type. You must associate the content (MIME) type of a file with a helper application using Windows Explorer.

Procedure: How to Specify a MIME Type in Microsoft Windows Explorer

  1. Open Windows Explorer.
  2. Select Folder Options from the Tools menu.
  3. Select the File Types tab.
  4. Select a file type in the Registered File Types list box, then click the New Type button.

    The Add New File Type dialog box opens.

  5. Enter the following information.
    • In the Description of Type field, enter a description of your choice.
    • In the Associated Extension field, enter the extension for the file type.
    • In the Content Type (MIME) field, enter the MIME type for the file type and extension.
  6. Click OK to save your changes.

Reference: Supported MIME Types

WebFOCUS supports the following MIME types.

MIME Type

Application

File Extension

application/postscript

GhostView

.PS

application/x-prn

Printer (using PCL printer driver)

.PRN

application/x-dif

Microsoft Excel® or other spreadsheet

.DIF

application/x-doc

Microsoft Word

.DOC

application/x-xls

application/vnd.ms-excl

Microsoft Excel

.XLS, .E97, .WK1, .XHT

application/pdf

Adobe Acrobat Reader

.PDF

text/plain

Microsoft Notepad or other text editor

.WP or .HTS

text/html

Native browser format

.HTML

text/htm

Native browser format

.HTM

image/gif

Native browser format

.GIF

image/jpeg

Native browser format

.JPG, .JPEG

XML

Native browser format

.XML

Procedure: How to Display a Report in a Helper Application

  1. Create a procedure that includes the command
    ON TABLE PCHOLD FORMAT fmt

    where:

    fmt

    Is the file format for the data.

    For details on formats and complete syntax, see the Creating Reports With TIBCO WebFOCUS® Language manual.

    Caution: Keep in mind that a valid format for browser display in a helper application requires a supported MIME type.

  2. Create a launch page from which a user can run the report.
  3. Publish the procedure and launch page using App Studio. When you run the launch page, WebFOCUS returns the data to the browser in the format specified. The browser displays it using the appropriate helper application.

Example: Displaying a Report In Excel and Offering a Choice of Display Formats

The following are examples of displaying a report in an Excel spreadsheet and offering a choice of display formats.

Displaying a Report in an Excel 2000 Spreadsheet

The following is an example of displaying a report in an Excel 2000 spreadsheet.

  1. Create a procedure named HELPER, which generates a report on product orders:
    TABLE FILE GGORDER
    SUM QUANTITY BY PCD
    WHERE PCD IS 'B141' OR 'B142' OR 'F101' OR 'F102'
    ON TABLE PCHOLD FORMAT EXL2K
    END
  2. Create a launch page from which a user can run the report.
  3. Publish the procedure and launch page using App Studio.
  4. Run the launch page, and click the link. WebFOCUS returns the data to the browser in EXL2K format. The browser calls the helper application, Microsoft Excel 2000, and displays the report:
    Microsoft Excel diagram

Offering a Choice of Display Formats

The following is an example of offering a choice of display formats.

  1. Create a procedure named QASTATUS, which generates a quality assurance report on a plant (PLANT) of interest, in a format (FMT) of choice:
    TABLE FILE CENTQA
    ON TABLE SET PAGE-NUM OFF
    SUM CNT.PROBNUM AS 'Total Number,of Problems'
    SUM CNT.PROBNUM AS 'Problem by,Product' BY PLANT NOPRINT BY PRODNAME
    WHERE PLANT EQ '&PLANT'
    HEADING CENTER
    "QA Report for &PLANT"
    ON TABLE PCHOLD FORMAT &FMT
    END
  2. Create a launch page from which a user can run the report. The following sample launch page is named FORMATS. The letter on the left corresponds to the note explaining the code.
        <HTML>
        <HEAD>
        <TITLE>Multiple Display Formats</TITLE>
        </HEAD>
        <BODY BGCOLOR="#E3E3E3">
        <FONT FACE="Arial">
        <CENTER>
        <FONT SIZE="+1">Welcome to the QA Database</FONT>
        <HR WIDTH="45%" NOSHADE>
        </CENTER>
        <FORM ACTION="/ibi_apps/WFServlet" METHOD="get">
        <INPUT NAME="IBIF_ex" VALUE="qastatus" TYPE="hidden">
        <P>
        Select a plant to generate a report on product problems:
        </P>
        <SELECT NAME="PLANT">
        <OPTION>BOS
        <OPTION>DAL
        <OPTION>LA
        <OPTION>ORL
        <OPTION>SEA
        <OPTION>STL
        </SELECT>
        <P>
        <HR> 
    a.  <TABLE CELLPADDING="2">
        <TR>
        <TD CLASS="LABEL">Select a display format:</TD>
        <TD><INPUT TYPE="RADIO" NAME="FMT" VALUE="HTML" CHECKED>HTML</TD>
        <TD><INPUT TYPE="RADIO" NAME="FMT" VALUE="PDF">PDF</TD>
        <TD><INPUT TYPE="RADIO" NAME="FMT" VALUE="EXL2K">Excel 2000</TD>
        </TR>
        </TABLE>
        <P>
        <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="Submit">
        <INPUT TYPE="RESET" NAME="RESET" VALUE="Reset">
        </FORM>
        </BODY>
        </HTML>
    1. Radio buttons in a table prompt the user for the format (FMT), and the value is passed to the procedure.
  3. Publish the procedure and launch page using App Studio.
  4. Run the launch page.
    Launch page diagram
  5. Select ORL from the drop-down list. Select PDF for the format. Click Submit.

    WebFOCUS returns the data to the browser in PDF. The browser calls the helper application, Adobe Acrobat Reader, and displays the report:

    Adobe Acrobat Reader Diagram