Creating Reporting Objects

Topics:

With WebFOCUS Managed Reporting, a developer can easily transform complex views of data into simple objects labeled with common business terminology that every user can understand, such as Weekly Sales or Revenue. Developers or Managers create Reporting Objects that present available data using terms and formats meaningful to users. Users can then use Reporting Objects as templates for the creation of a wide range of reports and charts.

This topic describes Reporting Objects and how you can use them in WebFOCUS.

Reporting Object Tool

Topics:

How to:

Reference:

Reporting Objects are stored in folders in the tree within domain folders under the Content folder. They can include selection criteria (WHEREs), JOINs, virtual fields (DEFINEs), filters, and other WebFOCUS statements, as well as reports or charts supplied as templates.

Note: A Reporting Object will not show in the repository when the user cannot functionally use the Reporting Object.

The browser Reporting Object tool allows you to create, edit, test, run, or delete a Reporting Object or its components. The main interface, as shown in the following image, consists of a static Quick Launch toolbar, a ribbon of context-sensitive options, and a window that displays the components of the Reporting Object with which you are working.

Browser Reporting Object tool

Reference: Reporting Object Tool Quick Launch Toolbar

The Reporting Object tool Quick Launch toolbar is a static menu whose commands apply to the entire Reporting Object, not simply to the particular component that you have selected. The following table describes each command in the Reporting Object tool Quick Launch toolbar.

Button

Shortcut Keys

Command

Description


Reporting Object Tool menu Main button

None

Reporting Object tool main menu

Launches a menu allowing you to Save, Save As, Run, and Exit.


Reporting Object Tool menu Save button

Ctrl+S

Save

Saves the Reporting Object.


Reporting Object Tool menu Undo button

Ctrl+Z

Undo

Undoes the last action.


Reporting Object Tool menu Redo button

Ctrl+Y

Redo

Repeats the last action.


Reporting Object Tool menu View Code button

None

View code

Displays Reporting Object code in a read-only window.


Reporting Object Tool menu Runbutton

Ctrl+R

Run

Runs the Reporting Object.

Reference: Reporting Object Tool Ribbon

The Reporting Object tool ribbon is a menu whose commands apply to what you have selected, whether that is the Reporting Object as a whole, a particular component, or an individual example of a component. For example, a particular filter or filter group, if you have selected one, rather than selecting the entire Filter component.

The following table describes each command on the Reporting Object tool ribbon.

Button

Command

Description



New

Creates a new join, DEFINE statement, filter, or WHERE statement.


Reporting Object Tool Ribbon New button

Open

Launches InfoAssist to create or edit a report or chart, or launches the appropriate tool to create or edit a join, DEFINE statement, filter, or WHERE statement.


Reporting Object Tool Ribbon Edit button

Edit

Opens component source code in the text editor.


Reporting Object Tool Ribbon Properties button

Properties

Renames the selected filter or filter group.


Reporting Object Tool Ribbon Run button

Run

Runs the selected component.


Reporting Object Tool Ribbon Delete button

Delete

Deletes the selected item.


Reporting Object Tool Ribbon Delete All button

Delete All

Deletes all items of the type selected, for example, all WHERE statements, all filters in a particular group, or all filters in every group if the Filter component itself is selected.

Procedure: How to Create a Reporting Object

  1. Sign in to WebFOCUS Business User Edition.
  2. From the Home page, on the actions bar, click More, and then click Reporting Object .

    The Open dialog box opens, prompting you to select a Master File.

  3. Select a Master File and click OK.

    The Reporting Object tool appears.

Procedure: How to Edit a Reporting Object

Right-click the Reporting Object and select Edit.

Note: Double-clicking the Reporting Object runs the Reporting Object rather than allowing you to edit it.

Procedure: How to Save a Reporting Object

  1. Press Ctrl+S or click the Save Reporting Object Tool menu Save button icon on the Quick Launch toolbar.

    The Save dialog box opens.

  2. Type the name of the new Reporting Object in the Title field and click OK.

    From now on, clicking Save or pressing Ctrl+S saves the Reporting Object without launching the Save dialog box.

Running a Reporting Object From the Browser

Topics:

You can run a Reporting Object or any individual component of it from the browser. You can run a Reporting Object in the following ways:

  • Select the object in the Reporting Object tool and click Run, or right-click the object and click Run.
  • Right-click the Reporting Object on the Home page and select Run, or point to Run and click Run in new window or Run Deferred.

The Run option in the Reporting Object tool is enabled regardless of the setting of the Only Run as a Deferred Report property.

Expected Behavior of Running a Reporting Object

When you select and run a Reporting Object, the expected behavior is as follows:

  • When you define a Report or Chart component, all components of the Reporting Object run.
  • When you define a Report and Chart component, an HTML page opens, which enables you to select which component to run.
  • When you define filters in a Reporting Object, an HTML page opens, which enables you to select from the defined filters of the Reporting Object.
  • When you define parameters in a report or chart and the Reporting Object Prompt for Parameters property is specified, an HTML page opens, which prompts you for parameter values.
  • Reporting Object components are validated prior to run time. This means that errors are found and corrected more easily, since errors in individual components are detected prior to run time.
  • If you attempt to run a Reporting Object that is created without using the Report or Chart component, you receive the message:
    Your request did not return any output to display.
    Possible causes:
    - No data rows matched the specified selection criteria.
    - Output was directed to a destination such as a file or printer.
    - An error occurred during the parsing or running of the request. 

Properties of a Reporting Object

From the WebFOCUS Home page, you can view or edit the properties of a Reporting Object by right-clicking the object and selecting Properties. The Reporting Object Properties dialog box opens.

Components of a Reporting Object

A Reporting Object may contain any of the following types of components, which are run in the order of precedence, as listed:

  • Preprocessing Other (custom code that runs before all other components)
  • Joins
  • DEFINE statements
  • Filters, when applicable
  • WHERE statements
  • Report or chart templates
  • Postprocessing Other (custom code that runs after all other components)

Users using the Reporting Object to create a report do not see the DEFINE statements, WHERE statements, or JOIN commands defined in the Reporting Object, which are issued automatically every time a user accesses the Reporting Object. However, the report or chart components, including headers, footers, and styling features, are visible to authorized users who can use them to create their own customized report.

The filters defined in the Filter component are applied only if the user of the Reporting Object activates them when the report or chart based on the Reporting Object is run.

Preprocessing Other Component

Reference:

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.

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.

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 Using Filters to Customize the Display of Data and Creating Reports. 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 Changing Application Settings.

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 wf_retail_lite as the Master Filer.
  2. Select the Preprocessing Other component and click Edit.
  3. Type the following code:
    TABLE FILE retail_samples/wf_retail_lite
    PRINT WF_RETAIL_LITE.WF_RETAIL_SALES.COGS_US
    WF_RETAIL_LITE.WF_RETAIL_SALES.QUANTITY_SOLD
    WF_RETAIL_LITE.WF_RETAIL_SALES.REVENUE_US
    BY WF_RETAIL_LITE.WF_RETAIL_TIME_SALES.TIME_YEAR
    BY WF_RETAIL_LITE.WF_RETAIL_TIME_SALES.TIME_MTH
    BY WF_RETAIL_LITE.WF_RETAIL_SALES.ID_SALES
    BY WF_RETAIL_LITE.WF_RETAIL_PRODUCT.MODEL
    WHERE WF_RETAIL_LITE.WF_RETAIL_TIME_SALES.TIME_YEAR EQ 2018;
    WHERE WF_RETAIL_LITE.WF_RETAIL_TIME_SALES.TIME_QTR EQ 1;
    ON TABLE HOLD AS baseapp/Extract01 FORMAT BINARY
    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=   251081  LINES= 251081

Joins

How to:

A join is a temporary connection between two or more data sources that share at least one common field. After you join two data sources, each time that WebFOCUS retrieves a record from the first data source (the host file), it also retrieves the matching records from the second data source (the target file).

For more information on joining data sources, see Joining and Blending Data.

Note:

  • When you join two FOCUS data sources, the target file field must be indexed or the join must be a WHERE-based join. If you attempt to link to a non-indexed target file, the Reporting Object tool offers you the opportunity to create a WHERE-based join. For more information on creating WHERE-based joins, see Joining and Blending Data.
  • Since every procedure creates a new session on the Reporting Server when it is run, the duration of your connection is always limited to a single procedure. Therefore, any join issued at the beginning of a procedure is in effect only for those report requests that are called in the same procedure.

Procedure: How to Create a Join

  1. Right-click the Joins component and select New, or select the Join component and click New on the ribbon.

    The Join tool opens, displaying the data source associated with the Reporting Object.

  2. Create a join using the Join tool.

    For more information on using the Join tool, see Joining and Blending Data.

  3. When you are finished, click OK to return to the Reporting Object tool.

Procedure: How to Delete a Join

To delete a join, right-click the join and select Delete, or select the join and click Delete on the Quick Launch toolbar.

Procedure: How to Rename a Join

  1. In the Join tool, select a join by clicking its connector line, and then click Edit on the Join toolbar.

    The Edit Join dialog box opens.

  2. Type a new description in the Description box and click OK to return to the Join tool.

    The new description appears under the Join component in the Reporting Object tool. The internal name used for the join remains the same name assigned to the join when you created it.

    Note: The Description field is limited to 8 characters.

Procedure: How to View or Edit Join Syntax in a Text Editor

  1. Select the join and click Edit on the ribbon, or right-click the join and select Edit.

    The join code is displayed in a text editor.

  2. Make the desired changes and click Save to return to the Reporting Object tool. To exit without making any changes, click Close.

Virtual Fields (DEFINE Statements)

How to:

A virtual field is a field whose value is not stored in the data source but can be calculated from the data that is there. A virtual field takes up no storage space. It is created only when a user accesses the Reporting Object that includes the virtual field.

You use the Define tool to create a virtual field. Using this tool, you specify the virtual field name and format, and the expression that defines the field. An expression enables you to combine fields, constants, predefined functions, and operators into an operation that produces a single value. When you define a virtual field, you must specify a field format type, length, and appropriate display options.

For more information about defining fields, see Creating Virtual Fields.

Procedure: How to Create a Virtual Field

  1. Right-click the Defines component and select New, or select the Define component and click New on the ribbon.

    The Define tool dialog box opens, as shown in the following image.

    The Define tool
  2. Create a virtual field using the Define tool.

    For more information about the Define tool, see .

  3. Click OK to save the virtual field and return to the Reporting Object tool.

    The virtual field now appears in the field list when a user accesses this Reporting Object.

Note:

  • The field list shown in the Define tool is not updated to display new virtual fields until you exit from the Define tool and reopen it. If you are creating a virtual field (DEFINE statement) that uses a previously created virtual field in the expression, you must save the first virtual field before creating the second one.

    To save the first virtual field, exit from the Define tool by clicking OK. Reopen the Define tool to create the second field. Alternatively, you can type the name of the first virtual field in the expression instead of selecting it from the field list. In this case, you do not need to exit and reopen the Define tool.

  • Since every procedure creates a new session on the Reporting Server when it is run, the duration of your connection is always limited to a single procedure. Therefore, any DEFINE statements issued at the beginning of a procedure are in effect only for those report requests that are called in the same procedure.

Procedure: How to Edit a Virtual Field

Existing virtual fields appear under the Defines node, as shown in the following image.



  1. Right-click the virtual field that you want to edit and select Open, or select the virtual field and click Open on the ribbon.

    The Define tool dialog box opens, displaying the selected field.

  2. Make changes to the field name, expression, or format, and click OK to return to the Reporting Object tool.

Procedure: How to View or Edit a Virtual Field in the Text Editor

  1. Right-click the virtual field that you want to view or edit as text and select Edit, or select the virtual field and click Edit on the ribbon.
    The Text Editor opens, displaying the selected field.
  2. Make changes to the field name, expression, or format, and click OK to return to the Reporting Object tool.

Procedure: How to Delete a Virtual Field

  1. Right-click the virtual field that you want to delete and select Delete, or select the virtual field and click Delete on the ribbon.
  2. To delete all virtual fields at once, right-click the Defines component and select Delete All, or select the component and click Delete All on the ribbon.

Filters

How to:

Reference:

Filters enable users to quickly select predefined criteria that limit the data included in a report or chart. Filters are selection criteria (WHERE statements) that you create for users, who then select the filters needed to limit the data in a report or chart without having to create their own selection criteria.

In order to create a filter, you must create the filter group and define the filters that make up the group.

Note: The Undo and Redo functions are not available for the Filter component until you have created at least one filter.

For more information about filters, see Using Filters to Customize the Display of Data.

Procedure: How to Create a Filter Group

  1. Right-click the Filters component and select New, or select the Filter component and click New on the ribbon.

    The Reporting Object Filter Group dialog box opens.

  2. In the Filter Group Name field, type a descriptive name for the filter group folder.

    Make the filter group name as explicit as possible, because users depend on this name to select the correct filter to apply to their reports.

  3. Click OK.

    You are returned to the Reporting Object tool. The filter group folder appears below the Filter component node.

Procedure: How to Define a Filter

  1. Right-click the Filter group to which you would like to add a filter and select New, or select the Filter group folder and click New on the Quick Launch toolbar.

    The Reporting Object Filter dialog box opens.

  2. In the Filter Name field, type a descriptive name for the filter and click Add New if you plan to create multiple filters, or click OK if you plan to create only one filter.

    Make the filter names as explicit as possible, because users depend on these names to select the correct filter to apply to their reports.

    The Advanced Filter dialog box opens, as shown in the following image.

    Create a filtering condition dialog box
  3. Use the Advanced Filter dialog box to create the filter.

    For more information about defining filters, see Using Filters to Customize the Display of Data.

  4. When you have created the filter, click OK.

    If you clicked Add new in step 2, the New Filter dialog box opens. If you clicked OK in step 2, you are returned to the Reporting Object tool.

Procedure: How to Edit a Filter

Existing filters appear under the Filter group beneath the Filters node, as shown in the following image.



  1. Right-click the filter that you want to edit and select Open, or select the filter and click Open on the ribbon.

    The Advanced Filter dialog box opens, displaying the selected filter.

  2. Make your changes and click OK to return to the Reporting Object tool.

Procedure: How to Rename a Filter or Filter Group

  1. Right-click the filter or filter group that you want to rename and select Properties, or select the filter or filter group and click Properties on the ribbon.
  2. Type the new filter or filter group name in place of the current one and click OK.

Procedure: How to Delete a Filter or a Filter Group

  1. Right-click the filter or filter group that you want to delete and select Delete, or select the filter or filter group and click Delete on the ribbon.
  2. To delete all filters at once, right-click the Filter component and select Delete All, or select the component and click Delete All on the ribbon.

Procedure: How to View or Edit a Filter in the Text Editor

  1. Right-click the filter that you want to view or edit as text and select Edit, or select the filter and click Edit on the ribbon.

    The text editor opens, displaying the selected filter.

  2. Make your changes and click OK to return to the Reporting Object tool.

Reference: Filter Considerations With Amper Auto Prompting

When Amper Auto prompting is used (Prompt for Parameters is selected in the Advanced tab of the Reporting Object properties), there are scenarios in which users are prompted to provide amper variable values in selection criteria (WHERE statements) in the Reporting Object that the user did not save with the report. This is due to the internal processing of reports created from Reporting Objects. You can avoid this issue by using the Filter component to predefine selection criteria for users to include in reports. Only the filter or filters that users select for inclusion in their reports are evaluated by the WebFOCUS Amper Auto prompting facility.

Selection Criteria (WHERE Statements)

How to:

WHERE statements or selection criteria, restrict the data retrieved to only those records that meet the conditions that you specify. Filters are selection criteria that run when the user selects the filter in WebFOCUS. Other selection criteria run when the user opens the Reporting Object, preventing data values that do not meet the criteria from being available to the user.

Procedure: How to Create Selection Criteria

  1. Right-click the Where Statements component and select New, or select the component and click New on the ribbon.

    The New Filter dialog box opens.

  2. Double-click the red text or press F12 to edit the WHERE statement.

    For more information on creating selection criteria, see Using Filters to Customize the Display of Data.

  3. When you have created the selection criterion, click OK to return to the Reporting Object tool.

Report Component

The Report component creates a report template and saves it in a Reporting Object. The report template is used when a new report is created off the Reporting Object.

To create a report template, double-click the Report component, or right-click the component and select Open. InfoAssist opens, allowing you to create a report template.

Note:

  • To open the report source code in the text editor instead of InfoAssist, right-click the Report component and select Edit. Manual changes to the code may make the report incompatible with InfoAssist.
  • Syntax and error checking is not performed on the commands that you type until the Reporting Object is run.
  • If the Reporting Object contains both a report and a chart, the user is asked whether to run the object as a report or chart. The Reporting Object cannot be run simultaneously as both.
  • When Amper Auto prompting is used (Prompt for Parameters is selected in the Advanced tab of the Reporting Objects properties), there are scenarios in which users are prompted to provide amper variable values in selection criteria (WHERE statements) in the Reporting Object that the user did not save with the report. This is due to the internal processing of reports created from Reporting Objects. You can avoid this issue by using the Filter component to predefine selection criteria for users to include in reports. Only the filter or filters that users select for inclusion in their reports are evaluated by the WebFOCUS Amper Auto prompting facility.

Chart Component

The Chart component works exactly like the Report component. The Chart component creates a chart template and saves it in a Reporting Object. Authorized users can use the chart template to create a chart that suits their needs and then save the new chart.

To create a chart template, double-click the Chart component, or right-click the component and select Open. InfoAssist opens, allowing you to create a chart template.

For more information on using InfoAssist, see the WebFOCUS InfoAssist User's Manual.

Note:
  • To open the chart source code in the text editor instead of InfoAssist, right-click the Chart component and select Edit. Manual changes to the code may make the chart incompatible with InfoAssist.
  • Syntax and error checking is not performed on the commands that you type until the Reporting Object is run.
  • If the Reporting Object contains both a report and a chart, the user is asked whether to run the object as a report or chart. The Reporting Object cannot be run simultaneously as both.
  • When Amper Auto prompting is used (Prompt for Parameters is selected in the Advanced tab of the Reporting Object properties), there are scenarios in which users are prompted to provide amper variable values in selection criteria (WHERE statements) in the Reporting Object that the user did not save with the report. This is due to the internal processing of private reports created from Reporting Objects. You can avoid this issue by using the Filter component to predefine selection criteria for users to include in reports. Only the filter or filters that users select for inclusion in their reports are evaluated by the WebFOCUS Amper Auto prompting facility.

Postprocessing Other Component

The Postprocessing Other component contains custom code that must run after 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 Postprocessing Other component, double-click the component, or select the component and click Edit on the ribbon. Alternatively, right-click the component and select Edit. The Postprocessing Other dialog box opens.

Note:

  • Syntax and error checking is not performed on the commands that you type until the Reporting Object is run.
  • Commands in the Postprocessing Other component should not return a displayable answer set.

WebFOCUS

Feedback