Using arguments in a formula function action

Formula function actions are shortcuts for formulas that are used multiple times in a report or in multiple reports. Optionally you can specify one or more of the arguments of a formula function. This can be useful if, for example, a report contains multiple similar, but not identical, instances of a formula. Instead of specifying the entire formula for each instance, you can specify the formula name and the value of the arguments.

This example uses the feature in a more simple scenario than you would typically use.

This example uses a global variable called _test, with this content:

<Table><Row name="[Product]"><Property name="unique" value="[Product].[All Tires].[Car Tires All Season]" /><Property name="caption" value="[Car Tires All Season]" /></Row></Table>

To retrieve the Unique and Caption values from the variable you could use these two GETPROPERTY functions:

=GETPROPERTY(GlobalVariables._test.Text,"[product]","unique")
=GETPROPERTY(GlobalVariables._test.Text,"[product]","caption")

This example demonstrates how to simplify specification of these formulas.

  1. Right-click the root of the report catalog and select Actions.
  2. Click Add action. Specify myget as the name of the action and select Formula function as the mode.
  3. Specify property as the value of the Formula arguments input.
  4. Specify this function as the value of the Formula result parameter:=GETPROPERTY(GlobalVariables._test.Text,"[product]",Actions.property.Text)
    Local action variables are created automatically for each argument of a formula function that you specify. In the Edit Value dialog box, the property local action variable is available under the Actions node on the Variables tab.
  5. In a report, select Insert > Function. In the Insert Function dialog box select myget from the Action category of functions.
    The report displays =MYGET(property).
  6. Specify =MYGET("unique")
    The cell displays [product].[all tires].[car tires all season].