Creating a Guided Report

How to:

The advantage of using a Guided Report is that you can create one streamlined, highly parameterized report and from that one report, you can generate thousands of different report outputs at run time. It requires no knowledge of code to customize the final report with the data you want displayed.

A page with controls for the Guided Report parameters appears so you can customize and run different versions of the report dynamically, as shown in the following image.


Top of page

x
Procedure: How to Create a Guided Report Using One Variable for Each Selected Column
  1. Create a new HTML page in HTML Composer using Guided Report Mode. See the Designing a User Interface for a Web Application With the HTML Composer manual for more information on Guided Report Mode.

    Note: Autoprompt is not recommended because variables are not displayed in the correct context.

  2. In HTML Composer, invoke Report Painter to create a report component.
  3. Add all the fields you could want to be displayed in the report, as shown in the following image. You are creating a report with every possible vertical sort field, every possible horizontal sort field, every possible detail or sum field, and so on.

  4. Multi-select the fields you want to be a part of the same parameter group, in this case COUNTRY and CAR, as shown in the following image.

    Being a part of the same parameter group means those fields will appear in the same control.

    Note:

    • Multi-select fields must be the same type. For example, all sort fields, or all detail fields.
    • If the multi-select fields are not adjacent for the parameter grouping, Report Painter will reorder the columns to make the grouped columns adjacent to each other.
    • BY, ACROSS, PRINT, and SUM columns are allowed in parameter groups. DEFINE, COMPUTE, TOTAL, and RANK columns are not permitted in parameter groups.

  5. From the Columns toolbar, select the One variable for each selected column mode from the drop-down list, as shown in the following image.

    One variable for each selected column creates one control for every selected column with all the selected field names as values. In this example, we are creating a parameter group for two sort fields and another parameter group for two sum fields. There will be four controls, two having COUNTRY and CAR (sort fields) and the other having RETAIL_COST and DEALER_COST (sum fields).

  6. Click the Generate Parameter Group button . Each column title has an ampersand in the top-left to signify that it is a member of a parameter group. In this mode, each field has a different color scheme. For example, COUNTRY has a blue background with a yellow ampersand and CAR has a blue background with a white ampersand.
  7. In this example, multi-select the remaining fields and click the Generate Parameter Group button to create another parameter group.

    In this example, RETAIL_COST and DEALER_COST make up the second parameter group, as shown in the following image.

    Note that RETAIL_COST has a white background with a blue ampersand, and DEALER_COST has white background with a red ampersand.

  8. When the report is complete, close Report Painter and save the changes to return to HTML Composer.
  9. Run the HTML page.

    The page is displayed, as shown in the following image.

    Selecting different options from the controls and clicking Run will display different results, as shown in the following images.

    At least one field must be selected. Otherwise, a message will appear instead of the output.

    In the following image, COUNTRY, CAR, RETAIL_COST, and DEALER_COST are displayed.

    In the following image, only CAR and RETAIL_COST are displayed.

  10. Optionally, you can edit variable fields using the Variable Editor. To open the Variable Editor, right-click a column and select Edit Variable Fields from the pop-up menu, as shown in the following image.

    The Edit Variable Fields option is available when one column is selected or multiple columns of the same parameter group are selected.

    This is a scaled-down version of the Variable Editor. You can change the variable type only to Single Select or Multiselect (Single Select is the default). You can reorder the fields, add or delete fields, edit display and return values, edit prompt text, and change the variable name suffix. The scaled-down version of the Variable Editor is shown in the following image.

    You can edit the display and return values to have user-friendly values or more sophisticated WebFOCUS syntax. For example:

    Display Value: TOP 5 CAR SALES

    Return Value: HIGHEST 5 SALES


Top of page

x
Procedure: How to Create a Guided Report Using One Variable for All Selected Columns
  1. Create a new HTML page in HTML Composer using Guided Report Mode. See the Designing a User Interface for a Web Application With the HTML Composer manual for more information on Guided Report Mode.

    Note: Autoprompt is not recommended because variables are not displayed in the correct context.

  2. In HTML Composer, invoke Report Painter to create a report component.
  3. Add all the fields you could want to be displayed in the report, as shown in the following image. You are creating a report with every possible vertical sort field, every possible horizontal sort field, every possible detail or sum field, and so on.

  4. Multi-select the fields you want to be a part of the same parameter group, in this case COUNTRY and CAR, as shown in the following image.

    Being a part of the same parameter group means those fields will appear in the same control.

    Note:

    • Multi-select fields must be the same type. For example, all sort fields, or all detail fields.
    • If the multi-select fields are not adjacent for the parameter grouping, Report Painter will reorder the columns to make the grouped columns adjacent to each other.
    • BY, ACROSS, PRINT, and SUM columns are allowed in parameter groups. DEFINE, COMPUTE, TOTAL, and RANK columns are not permitted in parameter groups.

  5. From the Columns toolbar, click the One variable for all selected columns mode from the drop-down list, as shown in the following image.

    One variable for all selected column creates one control for all selected columns with all the selected field names as values. In this example, there will be two controls. One control will have COUNTRY and CAR as options, the other will have RETAIL_COST and DETAIL_COST as options.

  6. Click the Generate Parameter Group button . Each column title has an ampersand in the top-left to signify that it is a member of a parameter group. In this mode, each parameter group is assigned the same color scheme. For example, both COUNTRY and CAR have a blue background with a yellow ampersand.
  7. If you want another parameter group, multi-select the remaining fields and click the Generate Parameter Group button to create another parameter group.

    In this example, RETAIL_COST and DEALER_COST make up the second parameter group, as shown in the following image.

    Note that RETAIL_COST and DEALER_COST will both have a white background with a blue ampersand.

  8. When the report is complete, close Report Painter and save the changes to return to HTML Composer.
  9. Run the HTML page.

    The page is displayed, as shown in the following image.

    Selecting different options from the controls and clicking Run will display different results, as shown in the following images.

    At least one field must be selected. Otherwise, a message will appear instead of the output.

    In the following image, COUNTRY, CAR, RETAIL_COST, and DEALER_COST are displayed.

    In the following image, only CAR and DEALER_COST are displayed.

  10. Optionally, you can edit variable fields using the Guided Variable Definition dialog box. To open the Guided Variable Definition dialog box, right-click a column and select Edit Variable Fields from the pop-up menu.

    The Edit Variable Fields option is available when one column is selected or multiple columns of the same parameter group are selected.

    The Guided Variable Definition dialog box allows you to edit the prompt text, reorder the fields, edit the display and return values, and change the variable field suffix. Note that you cannot add or delete fields. The Guided Variable Definition dialog box is shown in the image below.

    Multiselect is the default for One control for all selected columns mode. This can be changed to Single select if you want.

    You can edit the display and return values to have user-friendly values or more sophisticated WebFOCUS syntax. For example:

    Display Value: TOP 5 CAR SALES

    Return Value: HIGHEST 5 SALES


Top of page

x
Procedure: How to Create a Guided Report With Report Options
  1. Create a new HTML page in HTML Composer using Guided Report Mode. See the Designing a User Interface for a Web Application With the HTML Composer manual for more information on Guided Report Mode.

    Note: Autoprompt is not recommended because variables are not displayed in the correct context.

  2. In HTML Composer, invoke Report Painter to create a report component.
  3. Add all the fields you could want to be displayed in the report, as shown in the following image. You are creating a report with every possible vertical sort field, every possible horizontal sort field, every possible detail or sum field, and so on.

  4. Multi-select the fields you want to be a part of the same parameter group, in this case COUNTRY and CAR, as shown in the following image.

    Note:

    • Multi-select fields must be the same type. For example, all sort fields, or all detail fields.
    • If the multi-select fields are not adjacent for the parameter grouping, Report Painter will reorder the columns to make the grouped columns adjacent to each other.
    • BY, ACROSS, PRINT, and SUM columns are allowed in parameter groups. DEFINE, COMPUTE, TOTAL, and RANK columns are not permitted in parameter groups.

  5. From the Columns toolbar, select a guided report mode from the drop-down list.
  6. Click the Generate Parameter Group button .
  7. Right-click a field that has been parameterized and select Options, as shown in the following image.

    In this example, the CAR field was selected. CAR is a vertical (By) sort field.

    The Field Properties window is displayed.

    For non-sort fields in one control for all selected columns mode only, the chosen options affect the last field selected in the control at run time. The WebFOCUS syntax representation of this is shown below.

    TABLE FILE CAR
    PRINT DEALER_COST RETAIL_COST SALES NOPRINT
    END

    Because SALES is the last column in the request, any options will be applied only to SALES.

    If these fields are a parameter group and you select DEALER_COST, then NOPRINT is applied to just DEALER_COST. If you select DEALER_COST and RETAIL_COST, then NOPRINT is applied to RETAIL_COST because it is last.

    PRINT <DETAIL_COST, RETAIL_COST> NOPRINT

    For sort fields, any options applied to that parameter group will be applied to all fields.

    The Sorting, Grouping, and Actions tabs have options that can be variable or added as real values (not variable). The grouping tab will only display for a numeric field.

  8. For each action, select On, Off, or Variable from the drop-down list, as shown in the following image. Variable makes the option a parameter whose value is prompted for at run time.

    In One control for each selected column mode, all options affect any field selected in the control for the report column that was used to create the options.

    Note: The Sort tab and the Actions subtab are only available for sort fields. Some of the options you can select for a sort field are: Underline, Skip Line, No Split, Page Break, and Restart Page Numbering. For detail and sum fields, options can be selected from the General tab. Some of the options you can select are Skip Line and Fold Line.

    Putting options on a sort field in One control for all selected columns mode will apply the options to all sort fields in the parameter group regardless of which one was used to create the options.

    Clicking the ampersand button for an option will open the Guided Variable Definition dialog box, as shown in the following image.

    You can change the Display Values and Return Values for an option, reorder values, and add or delete values, as shown in the following image.

  9. If you want another parameter group, multi-select the remaining fields and click the Generate Parameter Group button to create another parameter group.

    In this example, DEALER_COST and RETAIL_COST make up the second parameter group, as shown in the following image.

  10. When the report is complete, close Report Painter and save the changes to return to HTML Composer.
  11. Run the HTML page.

    The page is displayed with both the parameter groups and report options, as shown in the following image.

    Select different options from the controls and click Run to display different results.

    At least one field must be selected. Otherwise, a message will appear instead of the output.

    In the following image, CAR, COUNTRY, DEALER_COST, and RETAIL_COST are displayed with all options turned on.

    In the following image, CAR, COUNTRY, DEALER_COST, and RETAIL_COST are displayed with all options turned off.


Top of page

x
Procedure: How to Add a Guided Drill Down to a Column
  1. Right-click a column (or columns) in Report Painter and select Options.

    The Field Properties dialog box opens.

  2. Click the Drill Down tab.
  3. From the active object area drop-down list, select the column component (Column Title and Data, Column Data, or Column Title) from which you want to drill down.
  4. From the Drill Down Type drop-down list, click Execute Guided Procedure.
  5. Click Edit to open the Guided DrillDown dialog box, as shown in the following image.

    From the Guided DrillDown dialog box, you can:

    • Select the drill-down procedures you wish to choose from at run time and any parameters you wish to pass to those procedures.
    • Change the prompt text that the user sees at run time.
    • Change the variable name for the drill down.
  6. Click Browse and select the drill-down procedures from the Open dialog box.

    The return values and display values for the procedures are added to the Display Value and Return Value columns, as shown in the following image.

  7. Click the Add button if you want to add parameters to pass to a procedure at run time.

    You must select the procedure for which the parameters will apply on the left side before clicking the Add button on the right side.

    The Drill Down Parameter dialog box opens, as shown in the following image.

  8. From the Parameter name drop-down list, select the parameter used in the drill-down procedure and select the Field or Constant value option for the parameter value.
  9. Repeat steps 7 and 8 for each procedure listed on the left side of the Guided DrillDown dialog box.
  10. Click OK.

    The drill-down procedures are added to the field properties box, as shown in the following image.

  11. Select a target frame. This is optional and is for HTML reports only.
  12. Click OK and run the report.

    The user will be prompted with a list of drill-down procedures from which to choose from at run time, as shown in the following image.

    When the user selects a procedure, they can click the hyperlink in the report to perform the drill down to the selected procedure.


WebFOCUS