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
$V_GROUP_ROW + 
". " + 
$C_First_Name + 
" " + 
$C_Last_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 :
$C_Last_Name.toUpperCase()

Tuesday, April 27, 2010

NextReports (version 3.2) Formatting Conditions


A very useful feature for reports is the possibility to mark somehow a value.It may be outside a desired range or it may be equal / not-equal to a specified value. Think about a medical test report (if some index is less or greater than normal values).

To achieve this in NextReports, a new property called "formatting conditions" is used. By selecting a column or a function cell in the report layout, you could modify this property.

For example, we want to highlight in different colors the activity code inside a project time sheet. For every code we are interested in, we can choose a different foreground.


When we add a render condition, we can choose which property we want to modify at "render time" , like foreground, background, font, color. We select an operator, the value we want to compare with and the property value. The property value will overwrite the general cell property defined in the layout if the condition is met.


And the result is here :

Wednesday, April 21, 2010

Web Service to run reports


NextReports Designer uses a web service to publish / download reports to a NextReports server.

To integrate reports in a proprietary  application where we want to generate some reports with specific parameters from that application, we created a new report web service.

This will allow for a very simple integration with a NextReports server :
RunReportMetaData runReportMetaData = new RunReportMetaData();

runReportMetaData.setReportId(reportId);
runReportMetaData.setFormat(HTML_FORMAT);

Map parametersValues = new HashMap();
parametersValues.put("Id", 2);
runReportMetaData.setParametersValues(parametersValues);

try {
    String url = webService.runReport(runReportMetaData);
} catch (WebServiceException e) {           
    showError(e);
}

Table Widgets in NextReports Server


NextReports Engine has now support to export a report / chart to a table, a memory object with a header and data. This exporter is used on the NextReports Server to add a table widget inside the dashboard.


Widgets can be renamed through an editable label, near the collapse / expand button. Similar to charts, tables have settings (parmeters values), can be refreshed or deleted.

From server version 2.1widgets can be saved as excel. For a table widget this is obvious. For a chart widget, the excel will contain X column and all Y columns defined inside the chart.

Monday, March 22, 2010

XML Export


From 3.0 version a report can be exported to xml .

Generated predefined tags  are :

<document> for the exported file
<record> for any row from layout
<text> for static text
<image> for images

All the other tags for database columns, functions, hyperlinks, parameters, variables are represented by the name of the entities.

Some simple example for a report with just the columns in the detail band :
<?xml version="1.0" standalone="yes"?>
<document>
    <meta name="author" content="Advantage Software Factory"/>
    <meta name="creator" content="NextReports 3.0"/>
    <meta name="subject" content="Created by NextReports Designer 3.0"/>
    <meta name="date" content="Tue Mar 09 14:36:10 EET 2010"/>
    <meta name="keywords" content="www.next-reports.com"/>
    <record>
        <Project>Boom Server</Project>
        <First_x0020_Name>Brandon</First_x0020_Name>
        <Last_x0020_Name>Dunn</Last_x0020_Name>
        <Hours>2.0</Hours>
        <Date>2008-09-01</Date>
        <Activity_x0020_Code>WRK</Activity_x0020_Code>
    </record>
    ....... 
</document> 

Designer 3.0 & Server 2.0


NextReports Suite was launched with :
  • charts & dashboards
  • images for pdf, rtf, excel, html reports
  • xml export
Designer release notes
Server release notes

Friday, February 12, 2010

As easy as "Pie"


       In the same manner as report integration, to view a Next flash chart in you application you have to do three things :
  • start a local web server
  • write just a few lines of code which will create a json file :
ChartRunner runner = new ChartRunner();
runner.setChart(chart);
runner.setConnection(connection);
runner.setQueryTimeout(queryTimeout);
runner.setParameterValues(parameterValues);
OutputStream os = new FileOutputStream(webRoot + 
                  File.separatorChar + "data.json");
boolean result = runner.run(os); 
os.close(); 
  • open the url :
openUrl("http://localhost:" + webServerPort + "/chart.html?ofc=data.json");
And that is all. 

Friday, February 05, 2010

New Charts Types


New charts are emerged
  • Horizontal Bar Chart
  • Charts with more columns on Y Axis : comparative charts for Line, Bar and Horizontal Bar
  • Stacked Bar Chart

Seeing the designer downloads is very useful.

Thursday, January 21, 2010

Charts


Time to add charts to NextReports has come.

Similar to report, a new chart perspective is created. In here user will modify chart layout, which consists of four components : title, main, X Axis and Y Axis. Any component has a list of properties.


Charts can be previewed from NextReports designer. Default browser is opened with a flash object created from a json data file.

Charts can be published to a NextReports server where any user can add them to a a dashboard for viewing in real time.


Wednesday, December 09, 2009

NextReports - Image support

Designer v3.0 will add support to image rendering in HTML, EXCEL, PDF, RTF. A new Insert Image  action will be available in layout. Image will not be scaled.

Also NextReports Server will allow for adding report images . Download action will return a zip archive with '.report' file and image files if any.

Friday, November 27, 2009

NextReports - Metadata

Generated reports in HTML, EXCEL, PDF, RTF contain now metadata.

Every report has now a title (file name), author, subject, creator and keywords. From these you can see the NextReports Designer version, and the NextReports site link.


NextReports - Publish - revisited


Login Panel supports now not just to add, but also to edit and delete, a server. Also, the login for a specific server may be 'remembered'.

 

After a report is published  , name, server path and data source are also remembered, so a new publish update operation will be done faster.

Tuesday, October 06, 2009

NextReports - Publish


NextReports application allows for report publishing on a NextReports server. A NextReports server is a web application which manages data sources and reports and schedules reports to run at specific moments in time.

To publish a report , the user must know a NextReports server (ip and port) and must have a valid account on that server (user and password).

After the login the user is allowed to upload a report to server to a specific path.



The user is allowed to create folders on the server. Also , if the data source is not already on the server, the user can publish the current report data source.



The user can also download a report from the server making the work as easy as possible straight from the designer. You get your report from server , modify it and then put it back on the server, without accessing the NextReports web application .

Friday, September 18, 2009

NextReports - Column Size Revisited


Version 2.4 of NextReports will bring new features for resizing columns.

It is possible to select more columns headers and set the size for all of them with the mouse right click. The headers selection is done in the same way the cell selection is done :
  • with CTRL pressed the user can select more individual headers
  • with SHIFT pressed you can select all headers between two selections
  • with the mouse you can drag and select automatically the headers.


A ruler can be seen in the layout if ‘Show ruler’ property is checked in the settings. The ruler unit can be centimeter or inch and is set also in the settings. Red markers will show the A4 width for portrait and landscape.

Tuesday, September 15, 2009

NextReports - Parameters with default values


From version 2.4 NextReports will have support for default values in parameters definition.


The ‘Default‘ tab contains the default values the parameter can take. Those values can be added by hand to a list (as in previous image) or can be taken from an sql source . If the parameter has default values, those values will be selected at runtime. If parameter is checked as hidden the parameter will not be seen at runtime, and it’s values will be computed and set at the moment the query is executed.

For example if you need a hidden parameter that is substituted at every run with the current date, you can edit the source with “select sysdate from dual” for Oracle datasource. For Derby database used as demo you may use "select current_date from sysibm.sysdummy1". The user does not have to know the format of the select for the connected data source. A template button in the dialog source does it automatically.

Tuesday, June 23, 2009

NextReports - Column Size


From the new upcoming 2.3 version, it will be possible to set the size of the columns in the report layout.
After clicking the first button in the report layout toolbar, which means that the auto-size will be change to manual column size, the user will be able to right-click with the mouse on any column header and set a size in pixels for it. If the mouse is on the column line separator, it will change in a "resize" type and user will be able to drag it to the desired width (no less than 10 pixels and no more than 1500 pixels).

If the total column sizes is bigger than an A4 (portrait or landscape) the user will be notified by a message. The export for pdf and rtf will be in A4 format and it is done so that the report do not surpass that dimension.

By default the user is notified after every column resizing if the total width is bigger than A4 dimension. To disable this notification, in the settings configuration you will have to put the A4.warning property to false.

Thursday, April 30, 2009

NextReports - Stored Procedure Call


From version 2.2 of NextReports, there is the possibility to create a report from a stored procedure. To accomplish this, there is a syntax which must be used inside the query editor :
call <schema_name>.<procedure_name><(${P1}, ... , ${Pn}, ?)
where ${P1}, … , ${Pn} are procedure IN parameters. These can also be parameters defined for the query and will appear at runtime. The ‘?’ parameter is the cursor output parameter. For Oracle databases this is used. For other databases like MySql and MSSQL , the call must not contain ‘?’ parameter.

Inside this syntax , also the package (for Oracle) or catalog for other databases must be specified (if there are more procedures with the same name in different packages).

Oracle
call <schema_name>.<package_name>.<procedure_name>(${P1}, ... , ${Pn}, ?)
MSSql
call <catalog_name>.<schema_name>.<procedure_name>(${P1}, ... , ${Pn})
Not every stored procedure is a candidate for reporting. It can have any number of IN parameters. It must have an OUT parameter of type REF CURSOR (and only one) for Oracle. Must not have any other OUT parameters.

If some procedure parameters are also query parameters, they must be checked as ‘stored procedure parameters’ and a preview value must be set for them. This preview value must be used inside the procedure business to exit as fast as possible, making the column finding process as fast as possible.

The user can drag and drop a procedure from the explorer panel to the query editor panel. If the procedure is not a candidate for reporting a message will notify the user. If it is a candidate, the general syntax shown previously will be automatically written to the editor. The user will have to define the parameters if any.

The user can see in the explorer tree all the stored procedures. There is an action on Procedures node which will validate which procedures are candidates for reporting. This process will mark the candidates with another icon.

Thursday, March 19, 2009

NextReports Import


From version 2.1 the user can import its data sources, queries and reports from an older version (starting with 2.0). If a data source with the same name already exists, the imported data source will have a name finished with the creation time stamp. This action is accessible from the Tools menu and also from the 'Quick Start' panel.


The difference between Import and Restore is that for Restore the current workspace (data sources, queries, reports) are not kept, but for Import all the new files are added to the workspace. Restore does some more things : it also overwrites the visible schemas and the new database drivers added by user.