Calling an Update Assist Procedure From a WebFOCUS Report

In this section:

How to:

One way to use an Update Assist procedure is to call it from a WebFOCUS report. You can set up the WebFOCUS report so that a user can click on a row in the report and open the Update Assist procedure with the data from the row of the report.


Top of page

x
Procedure: How to Call an Update Assist Maintain Procedure From a WebFOCUS Report
  1. Create an Update Assist procedure that includes the following selections:
    1. In the Update Assist (Step 3 of 6) - Navigation Options window, select No key values required for your user interface.
    2. In the Update Assist (Step 5 of 6) - Output File Options window, note the names of your procedures. By default, Update Assist names them after the segments they are modifying in the data source.
  2. In the Report Painter, create a report using the same data source you used for the Update Assist project. The report must contain the key fields in the segment you want to update (if you do not want to view them in the results, you can make them invisible).
  3. Select the column you want to make "clickable" in the report, then select Options from the Properties menu.

    The Field Properties dialog box opens.

  4. Click the Drill Down tab and select Column Data from the active object drop-down list. This means the users cannot drill down from the title of the column in the report, only by clicking on the column data.
  5. In the Drilldown Definition drop-down list, select Maintain Procedure. This specifies that when the user clicks on one of the last names in the report, a Maintain procedure is executed.
  6. Enter the name of the Maintain procedure you want to execute in the Procedure name field.
  7. Specify the parameters that get passed to the Maintain procedure:
    1. Click Add in the With Parameters section.

      The Drill Down Parameter dialog box opens.

    2. For each key field in the segment, enter the following in the Parameter name field:
      segname_fieldname_Edit

      where:

      segname is the name of the segment that contains the key field.

      fieldname is the name of the key field (a key field uniquely identifies a record in a segment).

      _Edit must be typed exactly as shown. This is the convention for naming variables in Update Assist.

    3. Click OK.
    4. Repeat for each parameter that is to be passed to the Maintain procedure.

      Note: You must pass all key fields needed to locate the record you want to update, otherwise, the Maintain procedure will not have enough information to uniquely identify a record. For example, in the CAR file, if you wanted to update a particular car model, you would need to pass the country and car, as well as the model type to locate the model field.

  8. In the Drill Down tab, ensure the key field is selected in the list of parameters.
  9. Click OK.
  10. Close your procedure and save it.

When you run your report, you will see that all of the items in the selected column of the report are underlined and clickable. Clicking any item on the report opens the Update Assist form with the information for that item already filled in.


Top of page

x
Calling an Update Assist Project From a WebFOCUS Report Example

This example describes how to create a report in the Report Painter and then create a link to a simple Update Assist application that will update information in the report.

This example is broken down into two steps:

  1. Create an Update Assist project that updates a customer from the Videotrk data source. See Creating an Update Assist Project For the Videotrk Data Source.
  2. Create a report in the Report Painter that contains a simple list of the customers in the Videotrk data source. See Creating a Report With the Videotrk Data Source.

When you are done, you will have a WebFOCUS report that displays a list of customers in the Videotrk data source. Clicking on the last name of someone in this report will bring up a form where you can change information about a customer, or delete the customer from the data source. The result is shown in the following image:

WebFOCUS report diagram



Example: Creating an Update Assist Project For the Videotrk Data Source

The following is an example of creating an Update Assist project for the Videotrk data source.

  1. Create a project.
  2. Add the IBISAMP directory to the viewable directories for the project.
  3. Add the Videotrk Master File to your project.
  4. Right-click the Videotrk Master File and click Update Assist in the pop-up menu.

    The Update Assist (Step 1 of 6) - Select Segment(s) for Auto Update window opens. For details, see Update Assist (Step 1 of 6): Selecting Segments to Update.

  5. In the Select lowest segment or hierarchy you would like to auto update section, select the CUST segment.

    The CUST segment appears in the Segments section.

  6. In the Segments section, select the CUST segment again. The window appears as follows:

    Update Assist dialog box

  7. Click Next.

    The Update Assist (Step 2 or 6) - Segment & Field Options window opens.

  8. In the Update Segment Options section, set Update and Delete to Yes.
  9. In the Field View Options section, set Changeable to Yes for all fields except CUSTID, which is a key field. The window appears as follows:

    Segment & Field Options dialog box

  10. Click Next.

    The Update Assist (Step 3 of 6) - Navigation Options window opens.

  11. Select No key values required, then click Next.

    The Update Assist (Step 4 of 6) - Template and Style Options window opens.

  12. Select a color scheme from the supplied examples, and click Next.

    The Update Assist (Step 5 of 6) - Output File Options window opens.

  13. Review the list of files that your application will update. You should only see one file here, cust.mnt. Update Assist derived the file name from the segment name. You can change it if you wish, but if you do, make a note of the name you use, since you will need it when you create your report. Click Next.

    The Update Assist (Step 6 of 6) - Summary window opens.

  14. Review the summary of options you have chosen, and ensure Automatically run this project when you press the 'Finish' button is selected.
  15. Click Finish.

    WebFOCUS Maintain creates the cust.mnt file, based on the options you selected in Update Assist, and deploys it. During deployment, the Deploying Application window opens.

  16. When the button at the bottom of the Deploying Application window turns to Close instead of Cancel, click Close.

    WebFOCUS Maintain displays the first screen of the application you created and displays the message "Record not found." This is because the Maintain procedure that Update Assist created is expecting to be passed to a parameter containing a value for CUSTID (the key field).

    WebFOCUS Maintain diagram



Example: Creating a Report With the Videotrk Data Source

The following is an example of creating a report with the Videotrk data source.

  1. Create a procedure that uses the Report Painter:
    1. Right-click the Procedures folder in the project that contains the Update Assist procedure, and select New from the pop-up window, then select Procedure.

      The Add Procedure dialog box opens.

    2. Enter update in the File Name field and click Open.

      The Open dialog box opens.

    3. Select Videotrk and click Open.

      The Report Painter opens.

    The Add Procedure dialog box opens.

    The Open dialog box opens.

    The Report Painter opens.

  2. Place the LASTNAME, FIRSTNAME, CUSTID, and PHONE fields in the report. Optionally, select the LASTNAME field and click By to sort by the LASTNAME field.
  3. Select the LASTNAME field on the report, and select Options from the Properties menu.

    The Field Properties dialog box opens.

  4. Click the Drill Down tab.
  5. In the active object drop-down list, select Column Data so that the users cannot drill down from the column title LASTNAME, only from the data in the report.
  6. In the Drill down Definition drop-down menu, select Maintain Procedure. This specifies that when an user clicks on one of the last names in the report, a Maintain procedure is executed.
  7. Enter cust in the Procedure name entry box (or, if you renamed your procedure when you created your Update Assist application, enter the new name).

    The Field Properties window appears as follows:

    Field Properties window

  8. Specify the parameter that gets passed to the Maintain procedure cust:
    1. Click Add in the With Parameters section.

      The Drill Down Parameter dialog box opens.

    2. Enter CUST_CUSTID_Edit in the Parameter name box.
    3. Select CUSTID from the drop-down list in the Parameter value section.

      The window appears as follows:

      Drill Down dialog box

    4. Click OK.

    The Drill Down Parameter dialog box opens.

    The window appears as follows:

    Drill Down dialog box

  9. Close your procedure and save it.

    When you run your report, you will see all of the last names in the report are underlined and clickable, as in the following example:

    FOCUS report diagram

    Clicking any name on the report opens the Update Assist form with the information for that name already filled in.


WebFOCUS