Inside NextReports Server any user can see a list of dashboards created by him or shared to him by other users. When the user logs-in he will see its personal dashboard 'My'.
In server 4.2 version, any dashboard will have a special action to set it as default (star icon). If no dashboard is set as default then 'My' dashboard is loaded at log in. If a dashboard is set as default then that dashboard will be loaded. If you follow only one dashboard in particular, this new feature will spare you the time of selecting it anytime you enter the application.
Tuesday, September 13, 2011
Friday, September 09, 2011
JDBC and Connection Timeout
If you want your jdbc driver connection not to wait more than a specified time even if the instance is down you may think that DriverManager.setLoginTimeout(seconds) is your friend. But if you test it with different drivers you will notice that for some it works and for some it does not.. So you are tight to the driver implementation which in many cases is not desirable.Given the fact that you can wait more than 30 seconds for a connection if the instance is down, it is imperative to look for alternatives.
The only general solution to this problem is to have a separate thread where you try to get the connection. You can set a timeout to complete the task of getting that connection. In java, FutureTask can be used to accomplish this:
The only general solution to this problem is to have a separate thread where you try to get the connection. You can set a timeout to complete the task of getting that connection. In java, FutureTask can be used to accomplish this:
Connection connection;
FutureTask task = null;
try {
task = new FutureTask(new Callable() {
@Override
public Connection call() throws Exception {
return DriverManager.getConnection(url, username, password);
}
});
new Thread(task).start();
connection = task.get(getConnectionTimeout(), TimeUnit.SECONDS);
} catch (Exception e) {
throw new ConnectionException("Could not establish connection.", e);
}
Wednesday, August 24, 2011
Moving around with widgets
Version 4.1 of NextReports was out. We are looking now to the following 4.2 release.
A small, but important new feature will be the possibility to copy or move a widget from a dashboard to other dashboard. Do you have some nice dashboards with cool widgets and you want to make another dashboard and share it to other users? Now this task will be easier.
A new action "Copy / Move" can be found in the widget toolbar, before "Delete" :
This action allows to select your action (copy or move) and to execute it for the selected dashboard :
A small, but important new feature will be the possibility to copy or move a widget from a dashboard to other dashboard. Do you have some nice dashboards with cool widgets and you want to make another dashboard and share it to other users? Now this task will be easier.
A new action "Copy / Move" can be found in the widget toolbar, before "Delete" :
This action allows to select your action (copy or move) and to execute it for the selected dashboard :
Wednesday, August 03, 2011
JColorChooser History
JColorChooser in java can be used to select a color from "Swatches", "HSB", "RGB" panels. But only "Swatches" tab has a history of recent used colors. We want to have a global history for selected colors.
For that we have to add another panel in a JColorChooser (like ExcelPalette). In java you have to create a new class which extends AbstractColorChooserPanel:
Anytime a color is selected from any tab except "Color History", that color is added to history as the top-left color from the matrix, and all the other colors are moved by a cell to the right.
At first glance it does not seem a "big" functionality, but when you think you want to use a number of colors to make your reports and charts look alike, this will help you a lot of time instead of entering again and again the same colors.
For that we have to add another panel in a JColorChooser (like ExcelPalette). In java you have to create a new class which extends AbstractColorChooserPanel:
public class HistoryColorChooserPanel extends AbstractColorChooserPanel {
@Override
protected void buildChooser() {
// here you add your UI components
}
}
To use it:AbstractColorChooserPanel[] panels = chooser.getChooserPanels() ; // create a new array of panels containing also your panel chooser.setChooserPanels(newPanels);
Anytime a color is selected from any tab except "Color History", that color is added to history as the top-left color from the matrix, and all the other colors are moved by a cell to the right.
At first glance it does not seem a "big" functionality, but when you think you want to use a number of colors to make your reports and charts look alike, this will help you a lot of time instead of entering again and again the same colors.
Friday, July 29, 2011
NextReports : Use hidden parameter inside another parameter
NextReports has a powerful support for parameters. You can have simple parameters, hidden parameters, chained parameters, procedure parameters. Parameters with values selected from table columns or from manual sources will have their type automatically selected. Parameters can have single or multiple selection. All of these will define how the user interface is created, what UI components will be used for selection.
Till version 4.1 only parameters used inside the main query had a meaning and were taken into account. New version will bring also a new feature regarding parameters usage.
A hidden parameter can now be used inside the source of another parameter without of being used inside the main query. Let's take a simple example.
We have a PROJECTS and a USERS tables. We want to select one or more projects for the user logged inside a NextReports Server, those projects which have the current user as project manager.
NextReports Designer has a special parameter __USER__ which has to be declared as following :
Value is passed to this parameter on the server and it means the name of the current logged user.
This parameter is defined as 'hidden', so it cannot be selected / modified from the UI.
We have to define our Project parameter and to use __USER__ parameter inside its source:
So, now we have a Project parameter which will filter data regarding to the logged user on the server. We design our report and we will use the Project parameter as a criteria :
The automatically created query inside the editor looks like this :
Till version 4.1 only parameters used inside the main query had a meaning and were taken into account. New version will bring also a new feature regarding parameters usage.
A hidden parameter can now be used inside the source of another parameter without of being used inside the main query. Let's take a simple example.
We have a PROJECTS and a USERS tables. We want to select one or more projects for the user logged inside a NextReports Server, those projects which have the current user as project manager.
NextReports Designer has a special parameter __USER__ which has to be declared as following :
Value is passed to this parameter on the server and it means the name of the current logged user.
This parameter is defined as 'hidden', so it cannot be selected / modified from the UI.
We have to define our Project parameter and to use __USER__ parameter inside its source:
So, now we have a Project parameter which will filter data regarding to the logged user on the server. We design our report and we will use the Project parameter as a criteria :
The automatically created query inside the editor looks like this :
SELECT
S1.PROJECT_ID,
S1.NAME,
S2.USER_NAME
FROM
ANYTIME.SPP_PROJECTS S1,
ANYTIME.SYS_USERS S2
WHERE
S1.PROJECT_MANAGER_ID = S2.USER_ID AND
S1.PROJECT_ID IN ${Project}
ORDER BY
S1.PROJECT_ID
Wednesday, June 22, 2011
Study Case : NextReports - A Real Time Exchange Rates Chart
From a developer's perspective, to have a real time chart, you need to have a database with real time data. We create a simple mysql database with only one table where we will insert currency values for every day (regarding our national currency RON).
create database currencies; DROP TABLE IF EXISTS ron_values; CREATE TABLE ron_values ( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), code varchar(3) NOT NULL, value decimal(10,4), exchange_date datetime );
First step to think of is where you get your data. We have this data offered in an xml file here: http://www.bnr.ro/nbrfxrates.xml. This file is changed every day except weekends and holidays.
The algorithm is pretty straightforward :
After we have our real time data, we need to create our Next chart. First we define a currency parameter to see only exchange rates for a specific currency :
Parameter values are taken from a source sql which gives us all currency codes. We also have to put a default value for this parameter because our chart will be used inside a dashboard.
We want to see data for last 15 days and mysql query is :
if (data_read_successfully) {
get_list_of_currency_objects
if (today_is_weekend_or_holiday) {
// the currencies values will be the same like in previous day
change_date_for_all_read_currencies_to_today
}
if (currencies_not_already_inserted_into_database) {
insert_currencies_into_database
}
}
We test if currencies were already inserted, because we do not want to depend on the date time when the xml file is updated, so our process can run lets say every hour or every minute. After we have our real time data, we need to create our Next chart. First we define a currency parameter to see only exchange rates for a specific currency :
Parameter values are taken from a source sql which gives us all currency codes. We also have to put a default value for this parameter because our chart will be used inside a dashboard.
We want to see data for last 15 days and mysql query is :
Select DATE(RV.EXCHANGE_DATE) as EXCHANGE_DATE,
RV.code,
RV.value
From ron_values RV
Where RV.EXCHANGE_DATE Between DATE_ADD(CURDATE(), INTERVAL -14 DAY) And CURDATE()
and ${P_Currency} = RV.code
order by RV.EXCHANGE_DATE
We see how our defined parameter is used between curly brackets ${P_Currency}.
If we run the query we will be asked to select the value for currency parameter :
Result will show us all desired values :
After we have the query we will create a new chart. We will select EXCHANGE_DATE column for X_AXIS and VALUE column for Y_AXIS. We will select all properties we want like chart type, labels, colors, fonts, patterns, legends:
We can preview the chart inside designer to see how it looks like :
Then we can publish the chart to a server and we can add it to a dashboard. You can see this chart on our demo server http://demo.next-reports.com/nextserver on the NextSite dashboard.
If we run the query we will be asked to select the value for currency parameter :
Result will show us all desired values :
After we have the query we will create a new chart. We will select EXCHANGE_DATE column for X_AXIS and VALUE column for Y_AXIS. We will select all properties we want like chart type, labels, colors, fonts, patterns, legends:
We can preview the chart inside designer to see how it looks like :
Then we can publish the chart to a server and we can add it to a dashboard. You can see this chart on our demo server http://demo.next-reports.com/nextserver on the NextSite dashboard.
Wicket Ajax Callback and FileUploadField
NextReports Server has an Upload action for different kind of reports. Besides selecting report files and images, user has to enter a name for the report. We wanted to automatically set the name after selecting file (for lazy people), but this approach proved to be incorrect.
We had something like in the following snippet:
So, we have to give up using this functionality.
We had something like in the following snippet:
uploadField.add(new AjaxEventBehavior("onchange") {
protected void onEvent(AjaxRequestTarget target) {
Request request = RequestCycle.get().getRequest();
String filename = request.getParameter("filename");
String text = getModel().getObject().getName();
if ((text == null) || "".equals(text.trim())) {
int index = filename.lastIndexOf(".");
if (index > 0) {
filename = filename.substring(0, index);
}
getModel().getObject().setName(filename);
}
target.addComponent(name);
}
public CharSequence getCallbackUrl(boolean onlyTargetActivePage) {
CharSequence callBackUrl = super.getCallbackUrl(onlyTargetActivePage);
return callBackUrl + "&filename=' + this.value + '";
}
});
Starting from IE8 and also in Chrome, but not yet in Firefox, according to the specifications of HTML5, a file upload control should not reveal the real local path to the file you have selected, if you manipulate its value string with JavaScript. Instead, the string that is returned by the script, which handles the file information is c:\fakepath.So, we have to give up using this functionality.
Monday, May 23, 2011
NextReports Server : Drill Down Table Reports
Starting from version 4.1, NextReports Server will be able to define drill down process for table reports. The number of levels to drill down is infinite.
To link two table reports you need to have a link parameter and to specify the column position whose value will be pass to the next report in the drill process.
All values from the column will be represented as links and the drill-down will happen just by clicking one of them.
The path (shown as the first column in the drill-down reports) will be composed from all the values clicked by user.
To link two table reports you need to have a link parameter and to specify the column position whose value will be pass to the next report in the drill process.
All values from the column will be represented as links and the drill-down will happen just by clicking one of them.
The path (shown as the first column in the drill-down reports) will be composed from all the values clicked by user.
Tuesday, April 26, 2011
Friday, April 22, 2011
NextReports : empty elements in designer
Till version 4.1 of designer when a new report was created all new empty cells from new rows or new columns were 'null'. That means when we select an empty cell no properties are seen in corresponding panel. Secondly, to merge one or more cells, only one cell must be not-empty and all the others must be null.
These facts make it harder to accomplish layout formatting for your reports.
Starting with 4.1 version, when new empty cells are created, they will be by default text-based with an empty string. The only case in which a band element is null is in a cell span.
The most important advantage is that we can start to format the cell immediately, we do not need a previous step of inserting an empty string. Practically the following business was modified :
These facts make it harder to accomplish layout formatting for your reports.
Starting with 4.1 version, when new empty cells are created, they will be by default text-based with an empty string. The only case in which a band element is null is in a cell span.
The most important advantage is that we can start to format the cell immediately, we do not need a previous step of inserting an empty string. Practically the following business was modified :
- merge algorithm allows to merge cells with empty string
- insert row & insert column actions from layout and from tree will insert band elements with empty strings
- merge action will nullify all cells without data (empty strings)
- unmerge action will insert empty band elements inside the 'null' ones
- add group action will insert empty band elements in header & footer
- new report action will insert empty band elements in footer row
Monday, April 04, 2011
NextReports Server - Single Sign On
NextReports Server allows integration with all your applications through Single Sign On using CAS.
To make this possible, NextReports defines a process which first brings the users into the content repository. A simple xml configuration will define synchronization process. You must specify your data source and your queries to get users names and users attributes (which allows to map any fields you may have to NextServer repository):
To make this possible, NextReports defines a process which first brings the users into the content repository. A simple xml configuration will define synchronization process. You must specify your data source and your queries to get users names and users attributes (which allows to map any fields you may have to NextServer repository):
<bean id="syncService" class="com.asf.nextserver.security.DatabaseExternalUsersService"> <property name="dataSource" ref="syncDataSource"/> <property name="userNamesQuery"> <value>SELECT USER_NAME FROM USERS</value> </property> <property name="userQuery"> <value>SELECT * FROM USERS WHERE USER_NAME = ?</value> </property> <property name="mapping"> <map> <!-- required --> <entry key="user.username" value="USER_NAME"/> ....... </map> </property> </bean>To define your CAS , a validation ticket must be written which will inform about cas login and cas logout urls:
<bean id="tValidator" class="com.asf.nextserver.web.security.cas.CasServiceTicketValidator"> <constructor-arg index="0" value="https://myurl:myport/cas"/> <property name="loginUrl" value="https://myurl:myport/cas/login"/> <property name="logoutUrl" value="https://myurl:myport/cas/logout"/> </bean>
Monday, March 28, 2011
Remote JDBC driver in NextReports 4.0
NextReports 4.0 has been released.
From this version, both designer and server will have the same major number. One of the new functionality from designer is the possibility to create a data source of type NextReports Server.
This means designer will use a driver found on the server. You do not need the driver on your computer. This JDBC driver is implemented using Web Services.
Driver's url has a special form jdbc:nextreports:@<server url>;<server data source> . When you edit the url you will have to select a NextReports Server and then you can browse the data sources tree on the server:
To be able to browse the data sources, the user and password entered for driver connection will be used.
This functionality is very important for companies which do not want to expose their databases.
From this version, both designer and server will have the same major number. One of the new functionality from designer is the possibility to create a data source of type NextReports Server.
This means designer will use a driver found on the server. You do not need the driver on your computer. This JDBC driver is implemented using Web Services.
Driver's url has a special form jdbc:nextreports:@<server url>;<server data source>
To be able to browse the data sources, the user and password entered for driver connection will be used.
This functionality is very important for companies which do not want to expose their databases.
Friday, March 18, 2011
NextReports Server : Profile Configuration
NextReports Server uses a profile concept which is attached to users that are not administrators.
A profile specifies two things :
1. what sections can be seen by users with such profile
NextReports Server has 7 sections : dashboards, reports, charts, data sources, monitor, scheduler and security. Any defined profile can contain one or more sections. By default , NextReports Server uses following profiles :
2. what actions need to be hidden for users with such profile
Even if the actions are shown regarding the permissions on a specific entity (report, chart, data source and so on), some of them must be hidden for a profile.
Configuration may be done in an xml file like this :
In this way it is very easy to add new profiles with your desired sections and visible actions making NextReports Server integration with your application as easy as possible.
A profile specifies two things :
1. what sections can be seen by users with such profile
NextReports Server has 7 sections : dashboards, reports, charts, data sources, monitor, scheduler and security. Any defined profile can contain one or more sections. By default , NextReports Server uses following profiles :
· Analyst : all sections
· Business user : Dashboards, Reports, Monitor sections
· Reports : Reports and Monitor sections
· Dashboards : Dashboards section
2. what actions need to be hidden for users with such profile
Even if the actions are shown regarding the permissions on a specific entity (report, chart, data source and so on), some of them must be hidden for a profile.
Configuration may be done in an xml file like this :
<bean id="reportsProfile" class="com.asf.nextserver.security.Profile"> <property name="name" value="reports"/> <property name="displayName" value="Reports"/> <property name="sectionIds"> <list> <value>section_class</value> . . . </list> </property> <property name="hiddenActionContributorIds"> <list> <value>contributor_class</value> . . . </list> </property> </bean>
Tuesday, March 15, 2011
NextReports Server : search for invalid sqls
As inside NextReports Designer, NextReports Server 4.0 allows to look for reports or charts with invalid sqls.
This is done from search action and it is the best way to find all such sqls from a folder.
This is done from search action and it is the best way to find all such sqls from a folder.
Tuesday, March 08, 2011
NextReports Server : Embedded Widgets revisited
For generated iframe tag a width and a height parameters can be entered. They are passed to the open flash chart to draw at specified size.
Thursday, March 03, 2011
NextReports: check your sqls
A needed feature to come in NextReports is sql validation.
If some columns, tables or views where deleted or renamed, you can see a warning. Every query, report or chart can be checked without open it. But the real plus is when you do a bulk check on all your queries, reports or charts. In this way you can see very fast what sqls are not running anymore. And then you can open those, if any, and resolve the problem.
'Validate Sql' action can be found inside explorer tree on one of the following nodes:
If some columns, tables or views where deleted or renamed, you can see a warning. Every query, report or chart can be checked without open it. But the real plus is when you do a bulk check on all your queries, reports or charts. In this way you can see very fast what sqls are not running anymore. And then you can open those, if any, and resolve the problem.
'Validate Sql' action can be found inside explorer tree on one of the following nodes:
- any query, report or chart node
- queries root
- reports root
- charts root
- any folder found inside queries, reports or charts root
Thursday, January 27, 2011
NextReports : new page addon
For pdf, rtf, excel exporters, a new page option is very important. NextReports allows to specify that after every group, a new page (sheet for excel) will start :
From version 4.0, every row from layout has an action 'New page' :
When you select this property, a small '+' bullet will be shown over row icon :
From version 4.0, every row from layout has an action 'New page' :
When you select this property, a small '+' bullet will be shown over row icon :
NextReports : charts inside reports.
Till version 4.0 charts could be exported only as flash, needing an internal server to allow for previewing. Because a chart image could not be created programatically, a chart could not be inserted inside a report.
From 4.0 a chart can be also exported as a jpg image. Using this exporter, now it is possible to insert a chart inside a report (to be seen in HTML, PDF, RTF, EXCEL or saved in XML) :
A pdf result (for chart data analysis part) looks like :
A chart element is similar to an image element, the only difference is that for chart the image is dynamically generated. So, a chart element can be resized similar to an image element.
From 4.0 a chart can be also exported as a jpg image. Using this exporter, now it is possible to insert a chart inside a report (to be seen in HTML, PDF, RTF, EXCEL or saved in XML) :
A pdf result (for chart data analysis part) looks like :
A chart element is similar to an image element, the only difference is that for chart the image is dynamically generated. So, a chart element can be resized similar to an image element.
Tuesday, January 11, 2011
NextReports : Text Flat File with fixed-length columns
NextReports 4.0 will bring a new type of file export, a simple text flat file. But instead of already existing csv and tsv types , this new "To Txt" exporter will allow to have fixed-length in characters for columns.
To specify size in characters for columns a new action was created which is similar with size in pixels.
Horizontal alignment property makes the text to be left-padded (for RIGHT value) or right-padded (for LEFT value). For CENTER value, text will be right-padded.
Result will be like this (for left-padded values) :
To specify size in characters for columns a new action was created which is similar with size in pixels.
Horizontal alignment property makes the text to be left-padded (for RIGHT value) or right-padded (for LEFT value). For CENTER value, text will be right-padded.
Result will be like this (for left-padded values) :
Subscribe to:
Posts (Atom)






























