Friday, May 14, 2010

Excel Palette

Excel offers only 56 colors in its standard palette. Java color chooser allows to select colors that are not understand by some Excel versions.

Because of that, we extended java JColorChooser with an "Excel Palette" tab to allow standard color selection:

In this way, we are sure that the selected colors will be the same in the generated excel file.

NextReports 3.2 : Group Row Variable

A Group Row variable is inserted from version 3.2

Depending on which band is used, this variable will show the current row from the enclosing group. If no group is defined inside report, this variable is identical with Row variable which shows the number of current record.

Using the variable inside an expression like
". " + 
$C_First_Name + 
" " + 
will show the next result :

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 :