Using Operators

[ ]

The following table contains predefined operators that LINQ Reporting Engine enables you to use in template expressions.

Primary x.y x?.y f(x) a[x] a?[x] new
Unary - ! ~ (T)x
Binary * / % + - << >> < > <= >= == != & ^ | && || ??
Ternary ?:

The engine follows operator precedence, associativity, and overload resolution rules declared at C# Language Specification 5.0 while evaluating template expressions. This behavior normally conforms to Java. But be aware of the following limitations and differences in the behavior comparing with the specification and Java behavior:

  • String equality and inequality check operators test string contents, rather than string references.
  • Whereas the object initializer syntax is supported (including objects of anonymous types), the collection initializer syntax is not.

Also, the engine enables you to use lifted operators in template expressions. In Java, operands of lifted operators are represented by primitive type class wrappers like Integer, Double, and others, in contrast to nullable types in C#. That is, for example, given that variables a and b are of the Integer type and the value of a is null, expression “a + b” is evaluated to null by the engine, whereas it throws an exception in Java during runtime.