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 2 of 4) - Navigation Options window, select No key values required for your user interface.
    2. In the Update Assist (Step 3 of 4) - Output File Options window, note the names of your procedures. By default, Update Assist names them after the segment they are modifying in the data source.
  2. In 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. Right-click the column you want to make clickable in the report, then select Options from the 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 Type 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. In the Procedure name field, type the name of the Maintain procedure you want to execute.
  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 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 an employee from the empdata data source. See Creating an Update Assist Project For the Empdata Data Source.
  2. Create a report in Report Painter that contains a simple list of the employees in the empdata data source. See Creating a Report With the Empdata Data Source.

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

WebFOCUS report diagram



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

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

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

    The Update Assist (Step 1 of 4) - Select Segment & Field Options window opens.

  5. In the Update Segment Options section, set Update to Yes.
  6. In the Field View Options section, set Changeable to Yes for all fields except PIN, which is a key field. The window is shown in the following image.

  7. Click Next.

    The Update Assist (Step 2 of 4) - Navigation Options window opens.

  8. Select No key values required and a color scheme from the supplied examples and click Next.

    The Update Assist (Step 3 of 4) - Output File Options window opens. You should only see one file here, empdata.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.

  9. Click Next.

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

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

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

  12. 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, as shown in the following image.



Example: Creating a Report With the Empdata Data Source
  1. Create a procedure that uses 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. Type update in the File Name field, select Report Painter from the Create with drop-down list, and click Open.

      The Open dialog box opens.

    3. Select empdata and click Open.

      Report Painter opens.

  2. Place the LASTNAME, FIRSTNAME, DEPT, and TITLE fields in the report. Select the PIN field and click By to sort by the PIN field.
  3. Right-click the PIN field on the report, and select Options from the 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 PIN, 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. Select empdata.mnt from the Procedure Name drop-down list (or, if you renamed your procedure when you created your Update Assist application, enter the new name).

    The Field Properties window appears as shown in the following image.

    Field Properties window

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

      The Drill Down Parameter dialog box opens.

    2. Select EMPDATA_PIN_Edit from the Parameter name box.
    3. Select the Field option and select EMPDATA.EMPDATA.PIN in the Parameter value section.
    4. Click OK.

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

    Drill Down dialog box

  9. Close your procedure and save it.

    When you run your report, you will see all of the PIN values in the report are underlined and clickable, as shown in the following image.

    FOCUS report diagram

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


WebFOCUS