Wednesday, 18 June 2014

NextReports: Report & Chart Internationalization

Starting from 7.2 version, NextReports will allow to have internationalized reports and charts. Users can define a set of string keys, a set of languages and the values for keys in every language. This is a special action found in Tools menu:

Only one language can be set as default. Default language is the one used when the report is run from designer. On the server side, Locale language set in Settings > General is used. If server Locale language is not defined inside report or chart, then the default language from report/chart is used.

The following things can be internationalized in reports & charts:
  • static text
  • parameters run time names
  • layout cell's pattern property
  • database column values (through expressions)
  • chart title, description, legends and tooltips
After the keys are defined, users can use them between @@ markups.

For example, a report layout with internationalized title and header column names looks like:

Our date column cell has an internationalized pattern:

where our datePattern key can be MM-dd-yyy or dd/MM/yyyy or any date pattern is needed.

$E{Activity} expression is defined to allow for database strings internationalization:

Knowing your values for Activity_Code column allows to define the needed keys: WRK, MTG, TRV, ADM (as you can see in first image). This is possible, because internationalization for expression is always done after it's evaluation.

Any parameter can have it's runtime name internationalized:

A chart can have title, description, X legend, Y legend, column legends and tooltip internationalized. For tooltip, user can enter even more than one key. This is useful for bubble charts where you can have more information inside tooltips. Such string can be like the following:

@@lifeExpectancy@@: #x
@@fertilityRate@@: #val
@@region@@: #c
@@population@@: #z

Using internationalized reports and charts will make server interaction more language-dependent. See below same dashboard in romanian and english:

Wednesday, 11 June 2014

NextCharts: Alarm Widget

'Alarm' is the oldest widget used by NextReports Server. It is just a status button with a specific color and a text. NextCharts 1.2 will contain alarm widget alongside indicator and display.

Being drawn on a HTML5 canvas, we can also add a shadow property for text and a simple animation. Json is very simple:
   "text": "Project delay is imminent! (Only 42 hours worked)",

Now, NextCharts widgets is a bigger family:

Monday, 2 June 2014

Display Report and Widget

From version 7.2 of NextReports a new type of special report is added. This is Display, and you can read about it in previous post.

As other special reports, there is a convention of representing this report. A "display" report layout looks like:

Header row band contains a title (in this case with a parameter value) and two boolean values for shouldRise and shadow properties described in previous post.

Detail row contains one column value ($C{value}) or two column values ($C{prev}). Second column value is the previous one (on a previous period of time). In case we have two values, inside band detail we will also have two expressions:

- up : to tell how "display" arrow is:

This is just a comparison between current value and previous value.

- percent : to compute the previous value as a percent:

In our example we have a table with quarter values, and we use a parameter Quarter:

Our query obtains the current and previous values as two database columns:

In our query "value" column contains the actual value and "quarter" column is the quarter string Q1, Q2, Q3 or Q4.

This is the theory behind a "display" report. This type can be selected from report root node inside layout.

To create a "display" report, users will use the Wizard tool. First step is to select a "display" type:

Then, after data source and columns/query selection steps, user has to choose one or two columns:

Following step will allow user to define the report:

In our case, we enter the parameter inside title, we choose some colors and that our value rising is a "good" thing. By clicking finish we will obtain the layout shown at the beginning of this post. Automatically the generated report will have "display" type selected.

Going to server, after a "display" report publish, users are allowed to add such widgets to dashboards:

Although, server will allow to see "display" widgets in statistics and to search for this kind of reports.