Monday, June 17, 2013

NextReports: Multiple Report

In general users want to insert a report inside another report to simulate a master-detail relation. To NextReports this means to insert a report inside the detail band of the master report, communication being done through a simple convention: the sub-report must have a parameter with the same name as a column from the master query.

This natural way (vertically data scaling) translates to generate a sub-report for every result from our query.You can read more about it here.

There are some situations when users want to scale their data horizontally and not vertically as in a master-detail form. Your query can become from too complicated to nearly impossible in achieving such thing. To make it easily possible, NextReports 6.1 introduced a new type of element inside report layout: Multiple Report.

Multiple Report element (FOR) contains a report with a special property: "multiple report sql" (FOR-SQL). The report must have a parameter with the same name as the column from FOR-SQL.

At run time,  this FOR element is replaced with a number of report elements. This number is the number of values returned by the FOR-SQL. A value from FOR-SQL will be passed to corresponding report's parameter.

To make it more clear, lets look at a simple example. We have a simple database with scores from EURO 2012 tournament. These scores are grouped on stages like Group First Game, Group Second Game, Group Third Game and so on until the Final. Inside database there are also kept the scores entered by some users. Any user guessed the result exactly, guessed just the prognostic 1/X/2 or did not guess anything and was rewarded with 3 points, 1 point, 0 points respectively. We want a report to show all the results as they happened and all the results entered by users with the rewarded points. We also want for every user to compute the total number of rewarded points per stage and per entire   tournament along with some other statistics.

To make an idea of what we want to accomplish I will start with showing you the results. You can see in the first image every stage with the games, scores, users scores and users rewarded points:


In the second image (the end of  report) you can see the statistics for the entire tournament:


This kind of report is a typical candidate for a "Multiple Report" usage. What we can observe by looking at the previous images is that report can be divided between to elements:
  • a stage element which shows the games from a stage and the scores

  •  a repetitive user element which shows the scores entered by user and the rewarded points

 So we need to create two reports. First one has just a grouping by stage (to show games and scores) and the labels for statistics section:


Second report has the same number of visible rows with the same fonts and padding for every corresponding row from the first report (We used some detail rows D1-D4 just to compute some expressions for statistics section, these expressions are hidden, and the detail rows D1-D4 are also hidden):

Second report also has a user parameter allowing us to run it for every user.

After that we can create a new report with the following layout (just two cells where we insert the previous reports):

We can see that the second report was added as a "Multiple Report" (FOR element). When we click the FOR element we can see it's properties with the new "multiple report sql". This query will return us the names of the users who entered scores for the tournament:


When you notice that you need a "Multiple Report" for your design, it is always easier (especially if you have a lot of rows) to create at first a single report which will show everything just for a single entity (user in our case).  Then you should cut it in two reports (left and right parts) and create the new report as showing before. In this way you are sure that all rows from the split parts have the same fonts and padding, so when you run the master report there will be no vertical shifts.

Tuesday, June 11, 2013

NextReports Designer: Favorites Menu

In NextReports 6.1 a new Favorites Menu can be found. Favorites are for NextReports what are Bookmarks for a browser. Practically, when a favorite is clicked, NextReports automatically connects to entity (report or chart) data source and the entity is loaded inside designer.

Any report or chart has a new action called "Add to favorites":


This action does just an addition to a list of entities which is stored in user home location. All favorites will be seen from Favorites Menu:

At the end of these links a "Remove favorites" action allows to manage favorites list.

Tuesday, May 14, 2013

NextReports Server: Data Migration

NextReports Server 6.1 will bring a new feature: data migration. Practically, a new section, visible only by administrators, is added.


From this section, administrator can export or import data. For data export we must select some entities like data sources, reports, charts and dashboards. The result will be a migration.xml file. There is no need to know which entities are used (referenced) by selected entities. All referenced entities will be automatically exported. Take a look at the following image:


We see that dashboard contains widgets. Widget contains a report or a chart. Report / Chart contains a data source and optionally links through drill-down to other reports or charts. So, by exporting a single dashboard, all entities that are involved will be exported too.

Any migration file can be used by an import process. When import is launched, a backup zip file of the entire repository is done. Any imported entity which has an id found inside repository will be updated. If id is not found, a new entity is created, taking care of name collision.

Migration process must not interfere with repository modification. Because of that, NextReports Server will show a maintenance page when export or import is running:



Thursday, May 09, 2013

Use NextReports for Information

When people think about reports they see almost every time analysis documents which aggregate their needed data in various formats. But reports can be anything else like simple information sheets. You can use data just to find answers to any domain you are interested in.

For example using a simple csv file with countries data we can find out needed information from a specific country like country code, phone code, capital, internet country code, currency and so on.

Query is done very easy with drag-and-drop designer's features. A Country parameter will allow to select information just for it:


A simple report will show us what information we are interested in:


Run it for desired countries and you are done.



This is just an example, but you can think at any csv data you can obtain live from the web (forecast, financial data). A simple (scheduled) process to get your csv file from web to a local storage is needed if you want up-to-date data. By comparing to saving to a regular database, such process does not need any programming!

Monday, April 22, 2013

NextReports Server: Settings per User

NextReports Server dashboards can contain any number and type of widgets like charts, tables, alarms, indicators, pivots. Any widget has a number of settings:
  • internal settings like refresh time, timeout, type (for charts)
  • parameters values
These settings can be modified and the state of widgets is changed for all users that have the right to see them.

Starting with 6.1 version a change will be done in the way these settings are kept.


If a user has write permission to a dashboard (dashboard was created by user or dashboard was shared to user with write permission) then these settings are stored globally and by changing them the global values are affected.

If a user has just read permission to a dashboard, user can still change the settings (in previous versions was not possible). In this case, the values for settings are kept just for the specific user. In this way it is possible for every user to have different settings for the same widget without altering the global values.

Monday, April 01, 2013

NextReports Server: Create your color theme

Starting from 6.1 version users can add their color theme to NextReports Server.

Color theme file must be named like theme-<color>.properties and must be added where the existing themes reside: webapps/nextserver/WEB-INF/classes/com/asf/nextserver/web/themes

All i18n files must contain a new property called:   Settings.personalize.theme.theme-<color>=<name of theme>

These color themes just change some foregrounds and backgrounds to make NextReports Server having the same chromatic as you desire.

There are also two images that are taken into account.

First is the actions image which is used in popups to decorate the actions menu and which you can define in theme files:

actions-image=actions-col-arrow-green.gif

Second image is the Ok  image used inside table columns when everything is as should be. This is not defined inside theme files. You just make sure that an image with name tick_<name of theme>.png exists inside images folder, otherwise the default is used.

Tuesday, March 26, 2013

NextReports: Get data from text files

NextReports 6.1 will allow to create a data source for CSV files. Using a CSV JDBC driver , users will be able to create reports and charts simply by providing data inside a csv file. Data source url contains the directory path where csv files are found:


There are some special properties which can be edited using driver properties:


You are not restricted to csv files, you can use any text file in which data is separated through a special separator. Csv file may contain the columns names on the first row, but generally those names should be specified in driver properties. Here user can also define the types for columns choosing between Int, String, Double, Boolean and Date.

Lets say, as a simple example, we have a simple csv file like the following with balance accounts for some persons:

1,mike,100
2,john,215
3,stevens,175
4,ann,89
5,dean,300
6,,

When we connect to the CSV data source we will see the csv files from that folder as tables and we can use them to create a report just like with any database data. The only restriction is that a query must be done on a single csv file. We cannot make joins between such tables.


We could make a simple report to compute the sum of balances:


We can also see that empty fields are correctly interpreted depending on the defined types:



Tuesday, March 05, 2013

NextReports Server: Alerts

NextReports Server introduces a new feature in version 6.0: Alerts.

The idea behind is that a user can be notified by email if a condition is evaluated as true. How can be this achieved inside NextReports Server? Very simple.

User has to schedule an alarm or an indicator report (those reports that offer a single value at a moment in time). Instead of adding alarm or report to a dashboard and periodically look at it to see if something wrong may occur, user will schedule them in the same way as a regular report. The only difference is in the way how the result is distributed.

A new destination type called alert must be selected. Alert is typically an email destination but without a "sending type". There is no link to the generated report, so the mail will contain just a simple message defined by user. Instead, a condition must be entered which compares the current value with one or two thresholds.


In case an alarm is scheduled, the mail message will automatically contain, at the end, the alarm's message.

Monday, February 25, 2013

NextReports: Indicators

NextReports 6.0 will introduce a new type of report called Indicator.  An indicator can be used if you want to follow a single value inside a predefined [min, max] interval. It has a title, a small optional description, an optional measure unit and a specific color.

As table and alarm, indicator will have a report layout defined by convention. To create such report you will have to complete two header rows and one detail row:
  • first header row has three cells : title, description and unit, last two being optional
  • second header row also has three cells: min value, max value and a boolean used to show or not to show these values
  • detail row has only one cell, a column or an expression, which will offer the needed value. This cell's foreground color will be used as indicator's color

You have to select indicator type for this report, so when you publish it to server it will be available for usage inside a dashboard.

Graphical representation inside server will look like the following:

In this image we can notice:

Title : Balance
Description : monthly
Measure unit : £
Min value : -1000
Max value : 1000
Actual value : -184 

Min, max and actual values are all followed by measure unit.

To easily create an indicator, you can use the Wizard tool. First you must tell wizard that you want to create an indicator:



After some steps like data source selection and query / columns selection, you will be asked to select just one column to be used by indicator:



Last step is used to set all indicator properties:



NextReports Server will allow to add indicator as a new type of widget to be seen inside dashboards:



Indicator was implemented as a HTML5 component with a color filling animation. In case your browser is old and cannot understand HTML5, indicator representation will fallback to a simple image drawn with Java2D.

Friday, February 22, 2013

NextReports: Internationalization made by user

With version 6.0 that also brings internationalization to NextReports Server, users can add other internationalization files to automatically have the possibility of changing to their needed language.

 You need to know language and country codes. The list for all locale codes can be found here. For example lets say you want to add Spanish  internationalization.

1) For NextReports Server, you can find i18n files in installation folder:
<install_directory>\webapps\nextserver\WEB-INF\classes\ro\nextreports\server\web

You should add here your i18n file. For Spanish you should create

NextServerApplication_es_ES.properties

All i18n files must contain a new property:  

Settings.personalize.language.es_ES= <language_name>

2) For NextReports Designer, the files can be found inside a jar file. In <install_directory> /lib inside nextreports-designer-6.0.jar there is a i18n folder. Using a zip utility like 7Zip you can add your new file here.

For Spanish you should create

next-ui_es_ES.properties

All i18n files must contain a new property: 


language.es_ES= <language_name>

Although, if you want to see your national flag in Language menu bar, you should have a 16x16 pixels image which you will put in the same jar in images folder. You should edit images.properties file from jar and add a new entry:

flag-es_ES=<image_name>.png

If you create such i18n file and want to share, please send it to us at next_support@asf.ro and we will add it to main distribution to be used by other users.

Monday, February 18, 2013

NextReports Server: Forgot Password

NextReports Server 6.0 login will bring a new feature to offer assistance to users who forgot their passwords. Inside login page a "Forgot Password" link can be seen.

When user clicks this link, he will be redirected to a new page to fill user name:

After user enters his name and clicks send, NextReports Server will send an email to that user with a reset password link. To make this possible,  NextReports Server must have all necessary email settings and the user must have associated a correct email address.

By clicking the link received by email, user will be redirected to a change password page:

This link will be active only for 4 hours. After the time elapsed, user won't be able to change his password.

Wednesday, February 06, 2013

NextReports Server Internationalization

NextReports Server 6.0 will allow to change your language between English, French and Romanian. This is done through settings panel:


Now, when you change your logo, theme and language, the refresh is automatically done.

Technically, in Wicket 1.5, this is done  using RenderPageRequestHandler:

getRequestCycle().scheduleRequestHandlerAfterCurrent(
             new RenderPageRequestHandler(new PageProvider(getPage()))
);

Tuesday, February 05, 2013

NextReports : Create tables & alarms through wizard

NextReports has a Wizard tool to be used for creating reports and charts in a simple and rapid way. Starting with upcoming 6.0 version, users will be also able to select report type.

For table there is no big difference than a default report. You select your columns and a template and the layout is almost identical with that of a new standard report. There is no header row with a title and no footer row.

For alarm, wizard is very useful because it will automatically create the needed layout (two cells, first with formatting conditions for color, second with an expression to show a custom message). This layout was explained in an earlier post.

Behind an alarm is a query that returns a single value for a selected database column. Wizard will follow the same first steps like: data source selection, query & column selection. After that, a special step will allow users to define the alarm:



Alarm conditions (formatting condition) are used to set the background color of alarm. These conditions must have disjunctive intervals (a value must be contained in just one interval).

For every created interval inside alarm conditions, user has to create a message. The alarm's actual value  can be used inside the message through a tag like $C_<column_name> .

There are two big advantages to use the wizard instead of creating an alarm by hand:
  • you do not have to know the convention how the alarm's layout must look
  • you do not have to know how to write the expression for alarm's messages

Tuesday, January 29, 2013

NextReports : Templates for Parameters' Values with Time Interval

NextReports Server has a feature called Templates for Parameters' Values which was explained here. User will be able to save a template of runtime values or to select a previously saved template to automatically load all values.

This template will be extended with a Time Interval starting with 6.0 version.

If a report has two parameters named by convention as start_date and end_date and those parameters have single selections and their type is one of Date, Time or Timestamp, then values templates panel will show also a selectable time interval:





This interval can be one of Yesterday, Today, Current Week, Previous Week, Current Month, Previous Month, Current Year, Previous Year and Last.

For all the intervals the two dates will be automatically filled with the corresponding dates. For example for Current Week, start_date will be the Monday of current week with hours, minutes, seconds and milliseconds equals to 0, while end_date will be the Sunday of current week with hours 23, minutes 59, seconds 59, milliseconds 999.

If Last interval is selected user will be able to select how many days, weeks, months or years are counted from current day:





For example for “Last 4 Months” start_date will be the same day as today but 4 months earlier with hours, minutes, seconds and milliseconds equals to 0, while end_date will be the current day with hours 23, minutes 59, seconds 59, milliseconds 999.

Friday, January 11, 2013

NextReports: Report Type Property

NextReports can  design two types of entities: reports and charts. Reports can also be classified in default, alarm and table. Alarm and table reports are special formats (defined by convention) which can be used inside NextReports Server dashboards.

To publish a special kind of report to server, user has to check it's purpose: Dashboard Table or Dashboard Alarm.


From NextReports 6.0 this information will be defined when we create the report. A new type property will be added to Report node:


This property can take a value from default, alarm, table. So when we will publish a table or an alarm to server, there will be no need to specify it's purpose, and the publish will look the same as for default reports:


This approach is more scalable and new report types can be added later without impacting the way they are published to NextReports Server.

Monday, January 07, 2013

NextReports Server: Demo inside installer

NextReports Server has a demo online at http://demo.next-reports.com where you can login with demo / demo.

When you install the server by yourself, till version 6.0, you won't see anything. It is a fresh content repository. To make it more interactive and to see main functionality inside dashboards, version 6.0 will allow to specify at installation if you want or not to have some demo data.


If you select this option, you will have a Derby demo database (same used inside NextReports Designer), some charts, some reports and a number of dashboards in which you can see the main chart types, alarms, tables, a pivot, a drill-down chart and a drill-down table.

Friday, December 07, 2012

NextReports Server : Iframe Tunning

NextReports Server allows to have any widget (chart, table, alarm, pivot) inserted in any HTML page through an iframe tag. This can be generated through "Embedded code" action:


You will get a code like :

This code has some parameters like widget id, width and height.

From version 5.4 users can define if they want to allow iframes or not. Inside Settings section some new properties can be used:


"Enable iframes" property will disallow the use of iframes if it is not selected.

"Use authentication" property will allow only for logged users to see iframes, if it is checked.

Also an iframe code can be modified to contain parameters. In this way more iframes with different settings can be used even if they have the same widget id. You have to add a new parameter :

..&P=<encrypted parameters string>

"Encryption key" is used by NextReports Server internal algorithm.

To create <encrypted parameters string> you will have to create a string with pairs of parameters and their values like :

$P{<parameter_1>}=<value_1>&$P{<parameter_2>}=<value_2>....

This string must be  then encrypted using an internal algorithm. Because this is application specific, I will not get into details.


Wednesday, November 14, 2012

NextReports: Efficiency Meter

NextReports formatting conditions can be used to highlight some data by changing background, foreground, font and border properties.

A very useful application is to generate something like an "Efficiency Meter" or any kind of "Meter". Such meter will show how some entities are found regarding some thresholds.

Let's take as an example of our "Efficiency Meter" a call center where different employees are talking with different clients. We set some thresholds for the number of phones per employee to know how they perform.

A sample report may show employee name, the number of phones taken for a period of time (in our example 11 hours), the number of clients involved and the average of calls for a period of time (in  our example 1 hour).


To define our efficiency meter we have to select different colors for our thresholds. For this we use formatting conditions. In our case, $E{Average} field has the following:


Result shows us in a nice format how everyone performed and it allows us to see in a glimpse if there are ups and downs.


Friday, November 09, 2012

NextReports Server: External Drill Down

From version 5.4 NextReports Server will define a new type of drill down. This can be any external url. Just add a new drill down like:


You can use the clicked value with a tag called ${value}.

Also, depending on last entity selected, you may be asked or not to select the column index used by table reports. If you have a table report as last drill before to add a url drill, this column will be shown, otherwise it won’t.

After adding a url drill down, no other drill can be added to that entity.