Preprocessing Other Component


The Preprocessing Other component contains custom code that must run before all other components. You can use the text editor in the component to create and edit code or to paste the code that you have copied from another application.

To create or edit a Preprocessing Other component, do one of the following:

  • Double-click the component.
  • Select the component and click Edit on the ribbon.
  • Right-click the component and select Edit.

The Preprocessing Other text editor appears.

See the Creating Reports With WebFOCUS Language manual for more information about using the WebFOCUS language to code procedures.

Note:

  • Syntax and error checking is not performed on the commands that you type until the Reporting Object is run.
  • Commands in the Preprocessing Other component should not return a displayable answer set.
  • InfoAssist previews in the Report component and the Chart component are disabled if the Preprocessing Other component contains the syntax:

    -OLAP ON

    To avoid this issue, enable OLAP through the Reporting Object properties instead of the Preprocessing Other component.

Reference: Considerations for Amper Auto Prompting With the Preprocessing and Postprocessing Other Components

When using Amper Auto prompting, users may be prompted to supply amper variable values for parameters that the private user content does not reference. These scenarios are directly related to the internal processing of reports created using a Reporting Object.

Auto prompting considerations and expected behavior must be understood when referencing amper variables within a Reporting Object. For information on the Amper Auto prompting facility, see the Developing Reporting Applications manual. The specification of values for the amper variables in the Reporting Object Other component using –DEFAULT, –DEFAULTH, or –SET commands will assign a default value for amper variables in a report request to avoid a FOC error for not specifying a value. A consideration for –DEFAULTH and –SET is that Amper Auto prompting does not prompt for amper variables that have values assigned using –DEFAULTH and –SET.

Whether a user is prompted by the Amper Auto prompting facility for amper variables assigned a default value using the –DEFAULT command is dependent on the setting of the WebFOCUS Client configuration parameter, IBIMR_prompting. When IBIMR_prompting is set to XMLPROMPT, users are prompted for amper variable values, and default values are displayed in fields in which the default values have been specified. When IBIMR_prompting is set to XMLRUN, users are not prompted for values when all amper variables have been assigned a default value. For more information on setting the IBIMR_prompting parameter, see the WebFOCUS Security and Administration manual.

Reference: Creating a Reporting Object That Uses a HOLD File

Suppose that your company has a data warehouse and you need a Reporting Object that uses an extract from that data warehouse. In your Preprocessing Other component, you create a HOLD file from the data warehouse, and then you use that HOLD file in each Reporting Object component. You can clear the JOIN command and delete the HOLD file in the Postprocessing Other component so that it is not mistakenly used again the next time that the Reporting Object is used.

This task has the following steps:

  1. Create a HOLD file in the Preprocessing Other component.
  2. Create a new Join component with two joins.
  3. Use the Report component to create a new report in InfoAssist.
  4. Clear the JOIN command and delete the HOLD file in the Postprocessing Other component.
  5. Run the Reporting Object, and then view the object source to verify that the output is correct.
  6. Verify that the HOLD file does not exist in the location in which it was created.

Example: Creating a HOLD File With the Preprocessing Other Component

  1. Create a Reporting Object with the baseapp and ibisamp selected as the application paths and employee as the Master File.

    For more information on creating a Reporting Object, see Properties of a Reporting Object.

  2. Select the Preprocessing Other component and click Edit.
  3. Type the following code:
    APP HOLD IBISAMP
    TABLE FILE EMPLOYEE
    PRINT EMPLOYEE.EMPINFO.DEPARTMENT AS 'NEWDEP'
    EMPLOYEE.EMPINFO.CURR_SAL AS 'NEWCURR_SAL'
    BY EMPLOYEE.EMPINFO.EMP_ID AS 'EMP_ID'
    BY EMPLOYEE.EMPINFO.HIRE_DATE AS 'NEWHIRE_DATE'
    ON TABLE HOLD AS WINFILE FORMAT FOCUS INDEX EMP_ID
    END                  
  4. Click Save, and then close the text editor.
  5. To verify that the component works properly, select the Preprocessing Other component and click Run.

    The following output is produced:

    0 NUMBER OF RECORDS IN TABLE= 12 LINES= 12

Example: Creating a New Join Component With Two Joins

  1. Select the Join component and click New.

    The Join component is prefilled with the data from the employee Master File.

  2. Click Add New , select the winfile Master File, and click OK.
  3. Click the Add New button, select the jobfile Master File, and click OK.
  4. Click OK to close the Join tool, saving your changes.
  5. Click View Code in the Reporting Object Quick Launch toolbar to review the code.

    The following code for the Join component is displayed:

    -*COMPONENT=Join_J001
    JOIN EMPLOYEE.EMPINFO.EMP_ID IN IBISAMP/EMPLOYEE
    TO UNIQUE WINFILE.SEG01.EMP_ID IN IBISAMP/WINFILE TAG J001 AS J001
    END
    -*COMPONENT=Join_J002
    JOIN EMPLOYEE.PAYINFO.JOBCODE IN IBISAMP/EMPLOYEE
    TO UNIQUE JOBFILE.JOBSEG.JOBCODE IN IBISAMP/JOBFILE TAG J002 AS J002
    END                  

Example: Creating a Report With the Report Component

  1. Double-click the Report component.

    InfoAssist is launched.

  2. Drag the NEWCURR_SAL measure from the Data pane to the canvas.
  3. Drag the EMP_ID dimension to the left of the NEWCURR_SAL column in the canvas, and select Drop as sort .
  4. Drag the NEWHIRE_DATE dimension to the left of the NEWCURR_SAL column in the canvas, and select Drop as sort.
  5. Drag the NEWDEP dimension to the left of the NEWCURR_SAL column in the canvas, and select Drop as sort .

    The report is displayed as a table with four columns, sorted by EMP_ID.

  6. Save the report and exit InfoAssist.
  7. To verify that the component works properly, click Run on the Quick Launch toolbar.

    The report that you created in InfoAssist is displayed in the browser.

Example: Deleting the Join in the Postprocessing Other Component

  1. Select the Postprocessing Other component and click Edit.
  2. Type the following:
    JOIN CLEAR *
    ? JOIN                  
  3. Click Save, and then click Exit.
  4. To verify that the Reporting Object works properly, click Run on the Quick Launch toolbar.

    The report that you created in InfoAssist is displayed in the browser.

  5. Right-click the report webpage and select View source.

    Note: Depending on your browser, information may display differently.

  6. Scroll to the bottom of the source window.

    The following comment is displayed:

    <!--
    0 NUMBER OF RECORDS IN TABLE= 12 LINES= 12
    0 NUMBER OF RECORDS IN TABLE= 12 LINES= 12
    0 HOLDING HTML FILE ON PC DISK ...
    JOINS CURRENTLY ACTIVE
    HOST                           CROSSREFERENCE
    FIELD        FILE      TAG     FIELD     FILE      TAG AS ALL WH
    -----        ----      ---     -----     ----      --- -- --- --
    EMPLOYEE.EM&gt;EMPLOYEE        WINFILE.SEG&gt; WINFILE J0 J0 Y N
    EMPLOYEE.PA&gt;EMPLOYEE        JOBFILE.JOB&gt; JOBFILE J1 J1 Y N
    0 NO JOINS CURRENTLY IN EFFECT
    -->