Thursday, May 06, 2010

Layout Expressions


From version 3.2 NextReports allows to insert expressions inside report layout.

Inside query designer there is already the possibility to add column expressions (any expressions that the current database type allows).

But if you have a query created with editor, the solution is to add expressions inside report layout. Such expression can contain besides sql columns, parameters and NextReports defined variables.


Columns $C{}, variables $V{} and parameters $P{} are evaluated at runtime, and after their evaluation the entire expression is evaluated. If expression is created in a cell outside detail or group bands , user cannot insert columns inside expression.

Expression editor allows to create :
  • numeric expressions : 
    $C_Hours * 60
  • string expressions :
    $C_Last_Name + " " + $C_First_Name
  • conditional expressions :
    if ($C_Hours < 8) { y=0; } else { y=1; }
For advanced users, it is also possible to call java methods for the specific object type. For example, for a String we can call any methods from java.lang.String class :
$C_Last_Name.toUpperCase()

1 comment:

Anonymous said...

Nice, I like it.