Creating the Multi-Component Procedure

How to:

After you create a project or application folder, you can begin building your application. In this section, we will create a multi-component procedure that contains Set, Define, Join, and Report components.


Top of page

x
Procedure: How to Create the Procedure
  1. In the Environments Tree panel, right-click Retail, point to New, and click Procedure.

    The Proceduren.fex canvas and the Procedure View panel open, as shown in the following image. The Procedure View panel is autohidden, by default.

    Proceduren.fex canvas opened

    Note: You can also create the new procedure from the Application menu, or the Quick Access Toolbar. If you choose to create the new procedure from one of these locations, you need to select the Retail project from the Navigate area.

  2. Close the Comment canvas.

    You can now add the Set, Define, Join, and Report components to the procedure.


Top of page

x
Procedure: How to Add the Set Component

Since we are creating a Define field within this procedure, and we plan to have a Join, we must first create a Set component that keeps all defined fields across a Join component.

  1. In the Procedure View panel, right-click the Comment component, point to New, and click Set.

    The Set canvas opens within the Proceduren.fex canvas, as shown in the following image.

    Set canvas

  2. In the Available Settings area, use the scrollbar to locate the KEEPDEFINE setting.
  3. Double-click KEEPDEFINE, or click KEEPDEFINE, and click Add.

    The KEEPDEFINE setting now appears in the Used Settings area, and OFF and ON options now appear in the Current Value area.

  4. In the Current Value area, click ON.

    You can check for code errors by clicking Check. This opens the Check dialog box, where you can view the code source and any error notifications. Click OK to exit the Check dialog box.


Top of page

x
Procedure: How to Add the Define Component

In the following procedure, you create a single Define field using the wf_retail_product Master File.

  1. In the Procedure View panel, right-click the Set component, point to New, and click Define.

    The Open File dialog box opens.

  2. Scroll through the list of Master Files, select wf_retail_product.mas, and click OK.

    The Define canvas opens as a second tab within the procedure, as shown in the following image.

  3. Type Product in the Define Field Name text box.
  4. Click Format.

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

    Format dialog box

  5. Under the Format Types area, click Alphanumeric.
  6. In the Length box, type or select 100.
  7. Click OK to save these changes and return to the Define canvas.
  8. Create the following expression: WF_RETAIL_PRODUCT.WF_RETAIL_PRODUCT_PRODUCT.PRODUCT_NAME| ',' | WF_RETAIL_PRODUCT.WF_RETAIL_PRODUCT_PRODUCT.MODEL

    You can create the expression by typing it directly into the Expression Builder window or by using the Fields List, and the number and operator buttons.

    Note: By default, the Fields List displays fields by name. When you double-click the field name in the Fields List, the qualified field name appears in the Expression Builder window.

    Product appears in the Field List.


Top of page

x
Procedure: How to Add the Join Component

In the following procedure, you create a Join. For more information on creating Joins in App Studio, press F1 while in the Join canvas.

  1. In the Procedure View panel, right-click the Define component, point to New, and click Join.

    The Open File dialog box opens.

  2. Scroll through the list of Master Files, select wf_retail_product.mas, and click OK.

    The Join canvas opens as a third tab within the procedure, and the Join tab opens on the ribbon, as shown in the following image.

  3. On the Join tab, in the Join group, click Add.

    The Open File dialog box opens.

  4. Scroll through the list of Master Files, select wf_retail_sales.mas, and click OK.

    The wf_retail_sales file appears on the canvas joined to the wf_retail_product file by a connector line, as shown in the following image.

  5. Repeat steps 3 and 4 to add the wf_retail_customer and wf_retail_geography Master Files.
  6. Click Save As in the Application menu.

    The Save As dialog box opens.

  7. Save the procedure as salesreport.fex.

Top of page

x
Procedure: How to Add the Report
  1. In the Procedure View panel, right-click the Join component, point to New, and click Report.

    The Report Wizard - Select a master file pane opens, as shown in the following image.

    Report Wizard - Select a master file

  2. In the Master Files area, click wf_retail_product.mas.
  3. Click Select Styling.

    The StyleSheet Selection pane opens, as shown in the following image.

    StyleSheet Selection window

  4. Click the Add new item button.

    The Open File dialog box opens.

  5. Click the Predefined Template Files folder.
  6. From the list of predefined templates, click ENBlue_Medium2.sty, and then click OK.

    When prompted, click Yes to confirm that you want to copy this template.

  7. In the StyleSheet Selection pane, click Finish.
  8. In the Report Wizard - Select a master file pane, click Finish.

    The Report canvas opens as a fourth tab within the procedure, as shown in the following image.

  9. Add the following fields to your report:
    1. Product
    2. COUNTRY_NAME
    3. STATE_PROV_NAME
    4. PRODUCT_COST
    5. QUANTITY_SOLD
    6. REVENUE_LOCAL

    You can double-click the fields in the Object Inspector, or drag them to the Report canvas.

  10. Create COUNTRY_NAME and STATE_PROV_NAME as WHERE clauses with dynamic parameters. On the Field tab, in the Filter group, click Filter, and then click Where. When the Expression Builder opens, create your WHERE clauses.
  11. Click OK to close the Expression Builder.
  12. On the Report tab, in the Report group, click Header & Footer, and then click Page Header.
  13. In the Page Heading area, type Sales Report for, followed by a blank space.
  14. From the Report Variables folder in the Object Inspector, double-click COUNTRY_NAME.

    The Insert Variable dialog box opens.

  15. Click Insert as literal value (FOCUS syntax: &COUNTRY_NAME), and then click OK.

    The COUNTRY_NAME variable now appears in the page heading.

  16. After the COUNTRY_NAME variable, type and, followed by a blank space.
  17. Repeat steps 14 and 15 for the STATE_PROV_NAME variable.
  18. Save your report, and close the Report canvas.
  19. Close the salesreport.fex procedure and click Yes when you are prompted to save the procedure.

WebFOCUS