• Login

DataSoft Corporation

Report Parameters with Expressions

Use the following syntax to insert parameters into expressions:

  • Type a question mark before a parameter's name.
  • ?parameter1
  • (Obsolete approach) Use the "Parameters." prefix before a report parameter's name.
  • [Parameters.parameter1]

Collection Elements Verification

Use brackets "[]" to check if a collection contains an element that satisfies a condition. The following expression returns true if the Accounts collection contains at least one element that satisfies the [Amount] == 100 condition:

[Accounts][[Amount] == 100]

The following expression returns false if the Accounts collection is empty:

[Accounts][]

Refer to the topic to see an example of how to use this syntax.

Parent Relating Operator

Use the parent relating operator ('^' character) to refer to a parent in expressions written in the context of a child. You can apply this operator successively to navigate multiple parent relationships.

You can use this operator to refer to the currently processed report group. This allows you to calculate aggregates within groups using expressions like the following:

[][[^.CategoryID] == [CategoryID]].Sum([UnitPrice])

Refer to the topic for details.

Grouping Clauses with Brackets

It is important to use brackets to ensure that your expression returns the intended results.

For instance, the following expression for objects of the Customer type returns all of the Customers where an Account exists with a Date of 8/25/2006 and where an account exists with an Amount of 100:

[Accounts][[Date] == #8/25/2006#] && [Accounts][[Amount] == 100]

Construct the expression as in the following example to search for all Customers that have an Account with both a Date of 8/25/2006 and an Amount of 100:

[Accounts][[Date] == #8/25/2006# && [Amount] == 100]

Thursday, 27 December 2018 Posted in Parameters