9 Using Action Buttons

This chapter discusses Action Buttons and how they are used in reports.

This chapter contains the following topics:

About Action Buttons

Action Buttons let you manually take some action on data in a report. Action Buttons can take data from an Action List or an Action Form to execute a read/write action on data input or selections from that action list or form. Action Buttons can also invoke actions without any data inputs if they are defined without reference to an Action List or Action Form.

Action Buttons can appear in any report, but some actions can be defined only in the Action List view. In order to do some action with the selected data in an Action List or Action Form you must create Action Buttons.

Creating Action Buttons

This section provides information about creating Action Buttons. It contains the following topics:

Creating Action Buttons

To create an Action Button:

  1. Create a report with an Action List view.

  2. Click Change Report Properties in the Actions list.

    The Report Properties dialog box opens.

  3. Select the Action Buttons tab.

  4. Click New.

    The Action Button Creation and Edit dialog box opens.

  5. Enter a Name and Description for the Action Button.

    The text you enter in the Name field is displayed as the button text in the report.

  6. Select Commit all actions in a single transaction to have all of the actions configured in this Action Button take place as a single transaction.

  7. Click Next.

  8. Click Add to define an action for this Action Button.

    The Action Editor opens.

  9. Select an Action Type from the list and click Next. Many action types only apply to Action List views as described in Table 9-1.

    Table 9-1 Action Types

    Action Type Description

    Insert

    Inserts a row into the specified data object and populates the column values of that row according to the defined mappings

    Constant Value Update

    Updates fields in the selected rows of the specified Action List with the defined value (Action List only)

    Edit Column Update

    Commits all edits made in editable columns from the specified Action Lists (Action List only)

    Delete

    Deletes all selected rows for the specified Action List (Action List only)

    Open a URL

    Opens a URL in a separate window. The URL is constructed by concatenating each of the specified terms.

    View a Report

    Opens a report and enables you to map values from the current report to parameters in the destination report.

    Reset a Form

    Clears any edits made to form inputs in the specified Action Form view or editable columns in the Action List view (Action Form and Action List only)

    Refresh a View

    Reloads the specified views

    Show a confirmation message

    Displays a confirmation message dialog box before performing any of the other actions configured for this Action Button.


  10. Define the action.

    See the action type configuration sections for more information:

  11. When you have finished adding actions, you can put them in order using the Arrange arrow buttons.

  12. Click Next.

  13. Format the Action Button.

    • Width specifies the width of the Action Button. Auto fit makes the button as wide as the button text or you can specify the width in pixels.

    • Button Location displays the button as part of the report or as part of a view.

      For Open a URL action types, when you display the button as part of a view you can alternatively choose to Display as a column of formatted links in the selected view. This option creates a hyperlink out of the values in the selected column instead of placing a button in the view. You can then choose to open a separate window, replace the view, or replace the report when a user clicks the link.

    • Alignment displays the button at the top or bottom of the report or view.

  14. Click OK to close the Action Button Creation and Edit dialog box.

  15. Click OK to close the Report Properties dialog box.

    The Action Button appears in the report.

Configuring Insert Action Types

The Insert action type enables you to insert a row into a target data object and populate the column values of that row according to the defined mappings.

To configure the Insert action type:

  1. Select the Insert action type in the Action Editor.

  2. Click Next.

  3. Click Browse to select the target data object for the insert. The mappings table is populated with the columns and data types of the target data object.

  4. Select a column and click Edit Mapping.

    The Value Mapping Creation and Edit dialog box opens.

  5. For each column, select a mapping type from the list.

    Table 9-2 Mapping Types for Insert Action Type

    Mapping Type Description

    None

    No mapping is done between the current and target data objects.

    Constant Value

    A constant value is inserted in the target data object. The specified value is validated against the data type of the column populated by this mapping. If you specify a string value for an integer column, an error message occurs.

    Prompt/Parameter

    The value held by the prompt or parameter is used as the value to insert in the target data object. It always retrieves the current value of a prompt or parameter even if it is changed by driving or surface prompts. To use this option the report must contain a prompt or parameter which is assigned to a filter in a view, or a custom parameter must be created in Server BAM Architect. See Chapter 8 for more information.

    Client Cookie

    Maps the value of a cookie that resides on the client where this report is viewed.

    Unique button click ID

    Maps a unique ID number (randomly generated) to the target field.

    Value from an ActionList view

    A value from the selected rows in an Action List is inserted into the target data object. The Insert a separate row for each into the Destination Data Object option causes there to be multiple result sets. In the Insert action type this results in multiple rows inserted in the target data object.

    A special case arises when there are multiple Value from an ActionList view mappings used in a single Action Button, and if more than one of those mappings have the Insert a separate row option selected. For example, if there are two rows selected in one Action List and three rows selected in another Action List, it results in 6 rows inserted into the target data object.

    Value from an ActionForm view

    A value from the selected input field in an Action Form is inserted into the target data object. Any inputs that have an rtsEnabledID attribute in the HTML is represented in the list of values.


    To populate the inserted row in the target data object with values, each column can be mapped to a different source of data.

    If a column is mapped to None, null is inserted for that column. If the column is non-nullable, the default value for the data type is used. For example, if there is no mapping specified for a non-nullable integer column, zero (0) is inserted. String is the only data type that does not have a default value. Therefore, if you attempt to insert null into a non-nullable string column, the action fails.

  6. Click Next.

  7. Enter the definition for the type you selected.

  8. Click OK to close the Value Mapping Creation and Edit dialog box.

  9. Edit the mappings for any of the other columns.

  10. Click OK to close the Action Editor.

Configuring Constant Value Update Action Types

The Constant Value Update action type enables you to update fields in the selected rows of the specified Action List with a specified value. This action type is used in Action List views only.

To configure the Constant Value Update action type:

  1. Select the Constant Value Update action type in the Action Editor.

  2. Click Next.

  3. Select an Action List view.

  4. Select a field in the Column list and enter a value in the Value field. Select Null if you want the value to be null.

  5. Click OK to close the Action Editor.

Configuring Edit Column Update Action Types

The Edit Column Update action type commits all edits made in editable columns from the specified Action Lists. The user does not have to select the check boxes to specify which rows should be updated. This action type is used in Action List views only.

To configure the Edit Column Update action type:

  1. Select the Edit Column Update action type in the Action Editor.

  2. Click Next.

  3. Select one or more Action List views with editable columns.

  4. Click OK to close the Action Editor.

Configuring Delete Action Types

The Delete action type deletes all selected rows in the specified Action List. This action type is used in Action List views only.

To configure the Delete action type:

  1. Select the Delete action type in the Action Editor.

  2. Click Next.

  3. Select one or more Action List views.

    If only one Action List is selected, and there are no other actions defined for the Action Button, you are given the choice to display the Action Button either as a regular button or a trashcan icon in the final step of the Action Button Creation and Edit dialog box.

  4. Click OK to close the Action Editor.

Configuring Open a URL Action Types

The Open a URL action type opens a URL in a separate window. The URL is constructed by concatenating each of the specified terms.

To open a report URL, you should use the View a Report action described in Configuring View a Report Action Types.

To configure the Open a URL action type:

  1. Select the Open a URL action type in the Action Editor.

  2. Click Next.

  3. Click New Term.

    The Value Mapping Creation and Edit dialog box opens.

  4. Choose a mapping type to create a term.

    Table 9-3 Mapping Types for Open a URL Action Type

    Mapping Type Description

    Constant Value

    A constant value is inserted in the target data object. The specified value is validated against the data type of the column populated by this mapping. If you specify a string value for an integer column, an error message occurs.

    Prompt/Parameter

    The value held by the prompt or parameter is used as the value to insert in the target data object. It always retrieves the current value of a prompt or parameter even if it is changed by driving or surface prompts. To use this option the report must contain a prompt or parameter which is assigned to a filter in a view, or a custom parameter must be created in Server BAM Architect. See Chapter 8 for more information.

    Client Cookie

    The value of a cookie that resides on the client where this report is viewed.

    Unique button click ID

    A unique ID number (randomly generated).

    Value from a List view

    A selected value in any List view. This is made possible when you elect to display a column as hyperlinks instead of creating a button for an action. See Creating Action Buttons, step 13. The Open a separate URL for each selected row option results in multiple URLs opened in separate browser windows.

    Value from an Action Form view

    The value of the selected input field. Any inputs that have an rtsEnabledID attribute in the HTML is represented in the list of values.


  5. Click Next.

  6. Enter the definition for the type you selected.

  7. Click OK to close the Value Mapping Creation and Edit dialog box.

  8. Select the Encode check box to encode the term.

  9. Create more terms if necessary.

  10. Select Click here to edit window features to change the browser window properties if necessary.

  11. Enter a maximum number of windows to open.

    When you use the Value from an Action List view mapping type and the user selects multiple rows in the list, you can open a separate URL for every checked row in the Action List. The maximum specified here limits the total number of windows that can be opened simultaneously. Opening too many windows simultaneously can cause the client system to malfunction.

  12. Arrange the terms in the correct order using the Arrange arrow buttons.

  13. Click OK to close the Action Editor.

Configuring View a Report Action Types

The View a Report action type opens a report and enables you to map values from the current report to parameters in the destination report.

To configure the View a Report action type:

  1. Select the View a Report action type in the Action Editor.

  2. Click Next.

  3. Click Browse to select the target report to open.

  4. Define mappings for each parameter in the target report.

  5. Select a parameter or prompt in the parameter column.

  6. Click Edit Mapping. The Value Mapping Creation and Edit dialog box opens.

  7. Select a mapping type from the list

    Table 9-4 Mapping Types for View a Report Action Type

    Mapping Type Description

    None

    No mapping is done.

    Constant Value

    A constant value. The specified value is validated against the data type of the column populated by this mapping. If you specify a string value for an integer column, an error message occurs.

    Prompt/Parameter

    The value held by the prompt or parameter is used as the value for the target parameter. It always retrieves the current value of a prompt or parameter even if it is changed by driving or surface prompts. To use this option the report must contain a prompt or parameter which is assigned to a filter in a view, or a custom parameter must be created in Server BAM Architect. See Chapter 8 for more information.

    Client Cookie

    The value of a cookie that resides on the client where this report is viewed.

    Unique button click ID

    A unique ID number (randomly generated).

    Value from an ActionList view

    A value from the selected rows in an Action List.

    Value from an ActionForm view

    A value from the selected input field in an Action Form. Any inputs that have an rtsEnabledID attribute in the HTML is represented in the list of values.


  8. Click Next.

  9. Enter the definition for the type you selected.

  10. Click OK to close the Value Mapping Creation and Edit dialog box.

  11. Edit the mappings for any of the other parameters.

  12. Select Click here to edit window features to change the browser window properties if necessary. This is the browser window that the target report opens in.

  13. Enter a maximum number of browser windows that can open.

  14. Click OK to close the Action Editor.

Configuring Reset a Form Action Types

The Reset a Form action type clears any edits made to form inputs in the specified Action Form view or editable columns in the Action List view.

To configure the Reset a Form action type:

  1. Select the Reset a Form action type in the Action Editor.

  2. Click Next.

  3. Select one or more Action Form or Action List views.

  4. Click OK to close the Action Editor.

Configuring Refresh a View Action Types

The Refresh a view action type reloads the specified views. This action is not needed for most views because they support active data and automatically update when the data changes. This action is useful for views that do not support active data:

  • External Content. This view can display any external URL, and it might be useful to supply a refresh button in the view if the content changes.

  • Action List with editable columns. Action Lists do not support active data when one or more columns is editable, so it is useful to supply a refresh button to display any changes to the data.

To configure the Refresh a view action type:

  1. Select the Refresh a view action type in the Action Editor.

  2. Click Next.

  3. Select one or more views.

  4. Click OK to close the Action Editor.

Configuring Show a Confirmation Message Action Types

The Show a confirmation message action type displays a confirmation message dialog box before performing any of the other actions configured for this Action Button.

To configure the Show a confirmation message action type:

  1. Select the Show a confirmation message action type in the Action Editor.

  2. Click Next.

  3. Enter the text to display in the confirmation dialog box.

  4. Click OK to close the Action Editor.