Creating a Q&A Query action

A DataLink Server action opens the DataLink Server Query Editor. The Query Editor displays a stored query which you can edit as necessary. The query is stored in an XML variable. In this example, you click a button in a report to edit the query. The report is updated with the edited query.

To create a DataLink Server action:

  1. Create a DataLink list.
  2. Create a report. Select cells C9 and D9 and drag the DataLink list onto cell C9.
    A vertical hyperblock is created in cells C9 to D9.
  3. Create a variable in which to store the definition of the query.
    This variable will be used as an input to the action.
  4. Open the Object Properties dialog of the hyperblock and click the List Designer icon on the General tab. The DataLink List Designer is displayed.
  5. Click the Settings and Preview tab and select the Variable query check box. Select the variable in which to store the query definition.
  6. Create a formula list called, for example, Query_columns.
  7. Drag the formula list to cell D8.
    A horizontal hyperblock is created in D8 to D9. The vertical and horizontal hyperblocks overlap at D9.
  8. Select the horizontal hyperblock and enable the List Designer. In the list designer, add the vertical hyperblock as an input but change the .text attribute to .columns. For example: =reportObjects.hyperblock1.columns .
  9. Select name as the caption.
  10. Create a new key index cell in the vertical hyperblock and add the horizontal hyperblock as the value.
    For example: =reportObjects.hyperblock2.text .

    See Multiple output cells.

  11. Create a command button in the report, labeled Edit Query.
  12. Create a Q&A Evolve action on the button.
    Select Click to execute an action in the Object Properties dialog of the button.
  13. In the Input query field, select the variable in which the query definition is stored.
  14. Add the variable in which the query definition is stored as a parameter. Select =Actions.Result.Text as the value of the parameter.
In View mode, the report displays the results of the Q&A query. When you edit the query, the report is updated with the results of the edited query.
Related topics