Starting from NextReports 8.1 iframes will be able to contain in their url some new parameters alongside width, height and report parameters. See this old post about iframe parameters.
Two of them are meaningful for table widgets: tableFontSize and tableCellPadding in points. These can be handy if you want to have an iframe on a big monitor screen and users need to look at it from distance. To show the difference you can compare following two screens:
The second one has tableFontSize=18 and tableCellPadding=10.
Another parameter, adjustableTextFontSize, has a boolean value and by setting it to true the chart from iframe will have texts from title, legends and axis values adjusted in concordance with iframe width. This parameter is automatically set to true on chart Detach action from NextReports Server.
A simple comparison can be seen here:
This example is shown for an iframe with width=800 and height=500 pixels.
Thursday, March 19, 2015
Thursday, March 12, 2015
How to access NextReports Server web services in your application
NextReports Server has a number of web services. These can be found in ro.nextreports.server.api. NextReports uses Jersey web services so in any web service class users can see @Path and @QueryParam annotations to know how to create the url. All urls start with:
If users need to access these services using java code, then a client for these services already exists and can be found in ro.nextreports.server.api.client. Inside designer installation folder in lib there is nextreports-server-client-8.0.jar library which can be used. To see how it is used in designer you can look in ro.nextreports.designer.wizpublish . Here is the code used to publish/download report/charts to/from server. (it involves also how to authenticate, to get list of entities from server, create a folder in server structure and more)
For example to authenticate you have to do the following with the root url previously shown:
To get entities from server:
This method sets the server url path by appending to base api url "storage/getEntities/" and then the folder path. There are some root constants used to create folderPath like /reports, /charts, /dataSources.
If you want to call Next web services from Javascript/JQuery and get reports from a path, you have also to be authenticated. Next example uses two javascript libraries:
Base64 encoder (jquery.base64.js) : https://github.com/carlo/jquery-base64/archive/master.zip
MD5 generation (core-min.js and md5-min.js) : https://code.google.com/p/crypto-js/#MD5
This example does an ajax get to obtain the list of reports from root /reports path. Request header contains an Authorization object. On success the list of entities (path and type) is shown in a html list.
To be able to run this example you must be in the same domain as server, otherwise a cross domain exception will be seen in console. From NextReports Server 8.1 inside web.xml for jersey.springServlet you can uncomment the following to allow for cross domain testing calls (please be sure to comment it back after you make your tests):
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>ro.nextreports.server.web.core.ResponseCorsFilter</param-value>
</init-param>
http://<server_ip>:<server_port>/nextreports-server/api
If users need to access these services using java code, then a client for these services already exists and can be found in ro.nextreports.server.api.client. Inside designer installation folder in lib there is nextreports-server-client-8.0.jar library which can be used. To see how it is used in designer you can look in ro.nextreports.designer.wizpublish . Here is the code used to publish/download report/charts to/from server. (it involves also how to authenticate, to get list of entities from server, create a folder in server structure and more)
For example to authenticate you have to do the following with the root url previously shown:
WebServiceClient client = new WebServiceClient();
client.setServer(url);
client.setUsername(userTextField.getText());
client.setPassword(new String(passField.getPassword()));
client.setPasswordEncoder(new Md5PasswordEncoder());
boolean authorized = false;
try {
authorized = client.isAuthorized();
} catch (Exception e) {
// connection error
e.printStackTrace();
return false;
}
To get entities from server:
List<EntityMetaData> entities = client.getEntities(folderPath);
This method sets the server url path by appending to base api url "storage/getEntities/" and then the folder path. There are some root constants used to create folderPath like /reports, /charts, /dataSources.
If you want to call Next web services from Javascript/JQuery and get reports from a path, you have also to be authenticated. Next example uses two javascript libraries:
Base64 encoder (jquery.base64.js) : https://github.com/carlo/jquery-base64/archive/master.zip
MD5 generation (core-min.js and md5-min.js) : https://code.google.com/p/crypto-js/#MD5
This example does an ajax get to obtain the list of reports from root /reports path. Request header contains an Authorization object. On success the list of entities (path and type) is shown in a html list.
<html>
<head>
<title>NextReports Server JQuery Test</title>
<script src="jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="jquery.base64.js" type="text/javascript"></script>
<script src="core-min.js" type="text/javascript"></script>
<script src="md5-min.js" type="text/javascript"></script>
<script>
var serverPath = "/reports";
var username="admin";
var password="1";
var passwordHash = CryptoJS.MD5("1");
var base64 = $.base64.encode( username + ":" + passwordHash );
$.ajax( {
type: "GET",
url : 'http://localhost:8081/nextreports-server/api/storage/getEntities?path=' + serverPath,
dataType : "xml",
beforeSend : function(xhr) {
console.log(base64);
xhr.setRequestHeader('Authorization', 'Basic ' + base64);
},
error : function(xhr, ajaxOptions, thrownError) {
console.log("error");
alert(thrownError);
},
success : function(data) {
console.log("success");
console.log(data);
$('#title').append(serverPath);
var paths = data.getElementsByTagName("path");
var types = data.getElementsByTagName("type");
var root = $("#list");
for (var i=0; i<paths.length; i++) {
var type = "";
if (types[i].textContent === "1") {
type = "folder";
} else if (types[i].textContent === "3") {
type = "next-report";
} else if (types[i].textContent === "4") {
type = "jasper-report";
}
root.append('<li>'+paths[i].textContent+ ' (' + type + ')</li>');
}
}
});
</script>
</head>
<body>
<div>
<span id="title">List of reports from path: </span>
<ul id="list"></ul>
</div>
</body>
To be able to run this example you must be in the same domain as server, otherwise a cross domain exception will be seen in console. From NextReports Server 8.1 inside web.xml for jersey.springServlet you can uncomment the following to allow for cross domain testing calls (please be sure to comment it back after you make your tests):
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>ro.nextreports.server.web.core.ResponseCorsFilter</param-value>
</init-param>
Tuesday, March 03, 2015
NextReports Server: Analysis
NextReports Server 8.0 has a new module (section) called Analysis. To be able to create an analysis, users must run/schedule an ETL (extract transform load) process which gets data from a data source and brings it locally to A NoSQL database. This process is just a run type defined in export property:
Anytime an ETL process is run, all data for it is first cleared and then new data is brought on.
Inside analysis section, users can select from existing "analysis sources" to create new analysis. At the beginning all the columns are selected and users will see the entire set of data.
From this step, users can start to play with data. New columns can be created like string concatenations, mathematical expressions, aggregate functions:
Users can select and order the columns they are interested in:
Users can sort, group and filter data:
Pagination is mandatory but can be modified to suit users needs:
After obtaining the results, users can save the analysis for future view. This is handy, because if there is a scheduled ETL process that brings data locally, users are able to see updated data just by entering the analysis section.
Results can be exported as excel and can be frozen. A "freeze" action means the data set is saved as a copy inside NoSql database and no other ETL process can modify it.
Analysis can be shared to other users. If there is no need for it, analysis can be deleted. This process will also delete the data set associated with it if there is no any other analysis linked to that data set.
To find more, you should read the server section manual.
Anytime an ETL process is run, all data for it is first cleared and then new data is brought on.
Inside analysis section, users can select from existing "analysis sources" to create new analysis. At the beginning all the columns are selected and users will see the entire set of data.
From this step, users can start to play with data. New columns can be created like string concatenations, mathematical expressions, aggregate functions:
Users can select and order the columns they are interested in:
Users can sort, group and filter data:
Pagination is mandatory but can be modified to suit users needs:
After obtaining the results, users can save the analysis for future view. This is handy, because if there is a scheduled ETL process that brings data locally, users are able to see updated data just by entering the analysis section.
Results can be exported as excel and can be frozen. A "freeze" action means the data set is saved as a copy inside NoSql database and no other ETL process can modify it.
Analysis can be shared to other users. If there is no need for it, analysis can be deleted. This process will also delete the data set associated with it if there is no any other analysis linked to that data set.
To find more, you should read the server section manual.
Thursday, February 19, 2015
NextReports Server: Capture dashboard as PDF
NextReports 8.0 will allow users to capture a dashboard as PDF. PDF file will contain a single landscape page with the visible part of the dashboard. This means all content which is not visible, because a scroll is involved won't be captured.
Users has a small number of tricks to make the dashboard full-visible:
- NextReports Server has a button to hide dashboards explorer
- Browser F11 button makes it to be visible in full screen
- CTRL+mouse wheel will allow to zoom-in/zoom-out the browser content
Using the tricks above we make a dashboard like the following to be fully visible:
PDF capture will generate a file which contains the dashboard name and a footer with generation date:
Users has a small number of tricks to make the dashboard full-visible:
- NextReports Server has a button to hide dashboards explorer
- Browser F11 button makes it to be visible in full screen
- CTRL+mouse wheel will allow to zoom-in/zoom-out the browser content
Using the tricks above we make a dashboard like the following to be fully visible:
PDF capture will generate a file which contains the dashboard name and a footer with generation date:
Tuesday, February 10, 2015
NextReports: Copy Destination
NextReports 8.0 will allow to define a 'Copy' destination type when a report is run / scheduled. This means a new report with user defined name will be created as a copy of the generated one. Because generated files have an unique name made of report name followed by a random UUID, it may be necessary sometimes to have a known name in order to access the file from an external application.
All existing destinations will have a new 'Changed file name' property which is optional. If user specifies another name for the report, then a file copy will be generated as well, that copy will be distributed to the destination and then the copy file will be removed. For 'Mail' destination this property has meaning only if the report is sent as attachment.
All existing destinations will have a new 'Changed file name' property which is optional. If user specifies another name for the report, then a file copy will be generated as well, that copy will be distributed to the destination and then the copy file will be removed. For 'Mail' destination this property has meaning only if the report is sent as attachment.
Friday, February 06, 2015
NextReports Server: ETL for Analysis
NextReports 8.0 version will bring something new in the way server can interact with data.
ETL (Extract Transform Load) process can be defined when any report is run or scheduled. ETL is practically selected in run formats list. After run, all data is brought locally to NextReports Server machine inside a OrientDB NOSQL database.
User will be notified when the process starts and when the process ends through NextReports Server messages.
Saved data can be used by a new Analysis feature, which allows any user with necessary rights to play with data.
ETL (Extract Transform Load) process can be defined when any report is run or scheduled. ETL is practically selected in run formats list. After run, all data is brought locally to NextReports Server machine inside a OrientDB NOSQL database.
User will be notified when the process starts and when the process ends through NextReports Server messages.
Saved data can be used by a new Analysis feature, which allows any user with necessary rights to play with data.
Wednesday, January 14, 2015
NextReports Server: IFrame Parameters
IFrames can be used to allow for embedding widgets in HTML pages. You can read about this in an old post.
The new version of NextReports will also allow to enter the parameters string, if any, making embedding code generation easier.
The usefulness of this is that if an encryption key is entered inside iframe server settings, then the embedded code will have the special P encrypted parameter automatically created.
The new version of NextReports will also allow to enter the parameters string, if any, making embedding code generation easier.
The usefulness of this is that if an encryption key is entered inside iframe server settings, then the embedded code will have the special P encrypted parameter automatically created.
Tuesday, January 06, 2015
NextReports: ExcelX Exporter
NextReports will be able to export to Excel xlsx format in the forthcoming release. Older versions could export only to xls file format.
In addition, user can now select as an excel template a file with extension xlsx or xlsm if macros are involved. If the template is with xlsm extension then the resulting file will also have xlsm extension to preserve the macros.
In addition, user can now select as an excel template a file with extension xlsx or xlsm if macros are involved. If the template is with xlsm extension then the resulting file will also have xlsm extension to preserve the macros.
Tuesday, December 02, 2014
NextReports: Single Table / Pivot Widget
NextReports Server can show inside a dashboard as many widgets as you like. But sometimes when you need all the space available, a single widget is desired. This may be the case when you have a table or a pivot widget.
To use as much space as possible dashboard must have a single column. Also dashboards tree may be hidden:
To use as much space as possible dashboard must have a single column. Also dashboards tree may be hidden:
The problem in versions 7.3 and previous is the height of the widget which has a fixed value. This is good in case two or more widgets are found inside a dashboard:
But if a single table /pivot widget is found, it would be nice to have the height 100%. So, newer versions of NextReports Server will take this into account, allowing for full space expansion:
Monday, November 24, 2014
NextReports & MS Acccess
NextReports will be able to create reports on MS Access Databases from version which will come after 7.3. (it may be 7.4 or 8.0, time will decide)
The newly born Java 8 has pushed Java driver implementations in a good direction. Java 8 has removed the JDBC-ODBC Bridge functionality. Now, database vendors without a pure Java JDBC driver are forced to create such drivers.
UCanAccess is a relatively new open source JDBC driver which allows to read/write Microsoft Access database. NextReports is now using it.
A simple connection definition has to specify the full path to access database file:
A new dialect was added and users can now create Next reports as with any other supported type of database:
The newly born Java 8 has pushed Java driver implementations in a good direction. Java 8 has removed the JDBC-ODBC Bridge functionality. Now, database vendors without a pure Java JDBC driver are forced to create such drivers.
UCanAccess is a relatively new open source JDBC driver which allows to read/write Microsoft Access database. NextReports is now using it.
A simple connection definition has to specify the full path to access database file:
A new dialect was added and users can now create Next reports as with any other supported type of database:
Friday, November 21, 2014
NextReports Designer: Name Pattern for Tables,Views and Procedures
Forthcoming release of NextReports will allow, after connecting to a data source, to set a 'name pattern' for Tables, Views and Procedures. This is useful in case you know the names of those entities you want to use in your queries reducing the time of loading. There may be thousands of tables in your database, so to have a filter is a nice addition.
'Name Pattern' is just a right-click action on Tables,Views and Procedures nodes from structure tree.
Users just enter a pattern using % sign (in this example we want all tables that start with BILL):
The Tables node will contain only filtered tables:
'Name Pattern' is just a right-click action on Tables,Views and Procedures nodes from structure tree.
Users just enter a pattern using % sign (in this example we want all tables that start with BILL):
The Tables node will contain only filtered tables:
Friday, October 10, 2014
NextReports: Docx Exporter
NextReports can supply many export formats for generated files like PDF, HTML, EXCEL, RTF, XML, CSV, TSV, TXT. Starting from version 7.3 DOCX can be also used.
Generated docx files must be seen with Word Microsoft Office 2007+. Other free applications like LibreOffice or OpenOffice may not be able to correctly render the file, especially if features like "new page", "vertical merge", "html text" or "sub-reports" are involved.
Docx exporter has also some restrictions:
Sample "Timesheet" report, that comes with demo database, has the following result as a docx file:
Generated docx files must be seen with Word Microsoft Office 2007+. Other free applications like LibreOffice or OpenOffice may not be able to correctly render the file, especially if features like "new page", "vertical merge", "html text" or "sub-reports" are involved.
Docx exporter has also some restrictions:
- "Page number" variable can be used inside header or footer band, but alone. If you use more cells, they will be ignored.
- "Total Page number" variable has no support.
- "Background image" has no support.
Sample "Timesheet" report, that comes with demo database, has the following result as a docx file:
Wednesday, October 01, 2014
NextCharts: Dual Y Axis
NextCharts can present any number of series on an existing chart. Chart type can be one of line, area, bar and even combo bar-line to allow for comparison results.
But there are cases when there it is needed to compare series with data of different order of magnitude. In such situations some series may look flat. To prevent this, NextCharts offers now the possibility to add a second Y axis.
Json definition may now contain 3 new properties:
These properties will also be found in NextReports Designer's chart layout from version 7.3
But there are cases when there it is needed to compare series with data of different order of magnitude. In such situations some series may look flat. To prevent this, NextCharts offers now the possibility to add a second Y axis.
Json definition may now contain 3 new properties:
- dualYAxis: true means second Y axis will be shown
- y2Count: this is the number of (last) series that will be represented on second Y axis (by default it is one)
- y2Legend: legend for second Y axis
Monday, September 29, 2014
NextReports: Excel Sheet Name
When a report is generated as Excel, sheets are named as "Page1", "Page 2" and so on. This is hard coded till version 7.3.
But starting with 7.3 version a new 'excel sheet name' property is used to address this issue.
If this property is left empty, sheets will have names like 1, 2, 3, ....
If user wants to use it, he has three options:
But starting with 7.3 version a new 'excel sheet name' property is used to address this issue.
If this property is left empty, sheets will have names like 1, 2, 3, ....
If user wants to use it, he has three options:
- Use a static list of strings: This is useful if you know from start how many sheets you have. For example A;B;C;D will name the first four sheets in this order as A, B, C, D. If there are more sheets than elements in the list, next sheets will have their page number as name.
- Use a template marker for page number ${NO}. For example Page ${NO} will name the sheets as Page 1, Page 2, Page 3, ...
- Use a template marker for group name ${G1}. This is useful if you have a group and you set "new page" after the group finishes, so you have group specific data on different sheets. In this case the sheets will be named with the group name. If there are more sheets than groups, next sheets will have their page number as name.
Tuesday, September 23, 2014
NextReports Evolution
Analyzing comparative data for previous and current year shows a strong positive evolution regarding the number of downloads (designer&server) and the number of updates (designer) made by users. Actual values are not displayed here, being sensitive data.
Number of updates has tripled in 2014 compared to 2013.
Number of downloads of all NextReports products has doubled this year compared to 2013.
This is very good news and I hope this trend will continue in following years.
Number of updates has tripled in 2014 compared to 2013.
Number of downloads of all NextReports products has doubled this year compared to 2013.
This is very good news and I hope this trend will continue in following years.
Monday, September 22, 2014
NextReports: New lines in Excel
NextReports Engine can select text data which may contain 'new line' characters like \r , \n or \r\n. These are well interpreted if report is generated in PDF or RTF. For Excel there was no posibillity until version 7.3.
If you have a character column with 'new line' characters, these will be replaced by Excel exporter. Exporter will also compute how many rows are present to know and to update the excel cell height accordingly.
Because this is a just a particular case, Excel exporter will not look to all texts for finding 'new line' characters. User has to select 'wrap text' cell property to true, to make searching active.
If you have a character column with 'new line' characters, these will be replaced by Excel exporter. Exporter will also compute how many rows are present to know and to update the excel cell height accordingly.
Because this is a just a particular case, Excel exporter will not look to all texts for finding 'new line' characters. User has to select 'wrap text' cell property to true, to make searching active.
Tuesday, September 09, 2014
Table Widget: Rows per page
Table Widget is just a simple component used by NextReports Dashboards. As all other widgets, it has two common properties:
Sometimes, a table widget may contain more data and pagination is used with a default of 100 rows per page. This not just helps with visualization, but it prevents OutOfMemory errors if someone is
- Refresh Timeout - how many seconds must pass until an auto-refresh
- Timeout - maximum number of seconds must pass until the database query is executed (otherwise a timeout exception is raised)
Sometimes, a table widget may contain more data and pagination is used with a default of 100 rows per page. This not just helps with visualization, but it prevents OutOfMemory errors if someone is
ill-intentioned and adds a table with millions of records inside a dashboard.
In general tables used in dashboards should have a small number of rows, but in case you really need a table with many rows, you are able from version 7.3 to set a "Rows per page" property.
This value can be set between 5 and 100 allowing to have a different pagination if business requires.
Thursday, August 14, 2014
NextReports: HTML Text inside PDF/RTF
Sometimes data inside database may contain simple HTML which has some formatting using tags like < b >,< i >,< font >, < br >. When we render to a HTML file, we will see data formatted as needed.
But it would be nice to have it also in PDF / RTF files. Starting with NextReports 7.3 this will be possible out-of-the-box. The only requirement is that data starts with < html > and ends with < /html > and contains a correctly formed HTML string.
Let's say we have a column in which data is HTML text like:
<html><b><font size=\"4\" color=\"blue\">Winters</font></b></html>
Then our PDF/RTF exported reports will look like the following:
If your column does not contain < html > and < / html > tags , you can create an expression and add them by yourself.
But it would be nice to have it also in PDF / RTF files. Starting with NextReports 7.3 this will be possible out-of-the-box. The only requirement is that data starts with < html > and ends with < /html > and contains a correctly formed HTML string.
Let's say we have a column in which data is HTML text like:
<html><b><font size=\"4\" color=\"blue\">Winters</font></b></html>
Then our PDF/RTF exported reports will look like the following:
If your column does not contain < html > and < / html > tags , you can create an expression and add them by yourself.
Tuesday, August 05, 2014
Display revisited
NextCharts 7.2 introduced a new type of report / widget called display. You can read about it here.
One thing that needs to be polished is title alignment. In 7.2 release title is aligned with value. This is good in all cases when value is big enough to be at least length comparable with title. But in case the value is small and title is longer, display does not look very nice.
Lets take a simple display example when the value is smaller than the title:
In such cases it would be nicer to center the title text. That's why we added a new property to NextCharts display making json containing titleAlignment with two possibilities: center or alignToValue. By default, alignToValue is selected if property is undefined. Choosing center for this property will make the widget looks as we desired:
When we define the report in NextReports Designer 7.3, title band element can have horizontal alignment property selected as center or left (right is not considered, generating inside json alignToValue).
One thing that needs to be polished is title alignment. In 7.2 release title is aligned with value. This is good in all cases when value is big enough to be at least length comparable with title. But in case the value is small and title is longer, display does not look very nice.
Lets take a simple display example when the value is smaller than the title:
In such cases it would be nicer to center the title text. That's why we added a new property to NextCharts display making json containing titleAlignment with two possibilities: center or alignToValue. By default, alignToValue is selected if property is undefined. Choosing center for this property will make the widget looks as we desired:
When we define the report in NextReports Designer 7.3, title band element can have horizontal alignment property selected as center or left (right is not considered, generating inside json alignToValue).
Monday, July 21, 2014
Scheduler Template Fields
NextReports Scheduler allows to schedule reports at some moments in time.
Special kind of reports like Alarm,Indicator and Display can be scheduled to raise an alert if the corresponding value is in some limits. To show the actual value in the email sent, a special template field ${val} is used.
NextReports 7.2 will add more template fields which can be used in email's subject or body. These fields are:
${date} for current date
${time} for current time
${name} for report name
Special kind of reports like Alarm,Indicator and Display can be scheduled to raise an alert if the corresponding value is in some limits. To show the actual value in the email sent, a special template field ${val} is used.
NextReports 7.2 will add more template fields which can be used in email's subject or body. These fields are:
${date} for current date
${time} for current time
${name} for report name
Subscribe to:
Posts (Atom)

































