How Do You Make Your Reports?

DZone 's Guide to

How Do You Make Your Reports?

· Java Zone ·
Free Resource
Almost all business applications need to have some reports to create statistics, goals or any kind of information needed for analysis. There are many tools and report engines used by developers or non-developers (like Jasper, BIRT, Crystal). Some are free, some are commercial. Some are BI tools, some are simpler.   Many people are complaining about existing solutions and they started to implement some for scratch to fulfill their needs. And that’s the way a reporting tool may start.

NextReports was in inception three years ago. Developers in our company used to create reports with Jasper. But many problems were making their lives harder. 80% of reports were not very complicated, but needed changes at a very short pace. Adding components and rearrange columns was time consuming. Reports were created by business analysts without Java knowledge, but they needed to know some Java classes for parameters definitions. Reports needed a compilation step before running, so in all of our server instances we needed to set in PATH variable the path to the java bin location.

All these things were factors which brought NextReports to life. First a simple report designer was created in Swing making use of all good libraries for desktop applications like Swingx, JGoodies, MyDoggy, JXLayer, JFreeChart.

NextReports Designer is a free and very simple ad hoc query and reporting tool. You can create your queries just with drag-and-drops or you can delve inside the query editor and write complicated queries or call stored procedures.

Query Designer

NextReports Designer can connect to popular databases, like Oracle, MySQL, SQL Server, PostgreSQL, Derby, Firebird.

With a query, you can create reports and charts. Report Layout is a simple grid structure like an excel sheet. You just edit your cells with text, parameters, variables, database columns, expressions, functions, hyperlinks. You can create groups and you set all your visual properties like colors, fonts, borders, patterns and many others. Reports can be exported to many formats like HTML, PDF, RTF, EXCEL, CSV, TSV, TXT, and XML. iText and poi libraries were used for pdf, rtf and excel exporters.

Report Layout

Chart Layout gives you the possibility to generate charts as flash using Open Flash Chart library or as image using JFreeChart library. In this way a chart can be added to dashboards for live visualization or can be inserted inside a report (where an image will be needed).

Chart Layout

Queries, reports and charts are saved as xml files using xstream library. With NextReports Designer you can do more than creating these entities like imports / exports of data sources, simple templates creation, backup & restore of all your workspace, publish your reports and charts to a NextReports server.

When you install NextReports Designer a Derby demo data source is present with a report and a chart so you may start instantly and see how things work.

Because NextReports Designer is a free tool, we also created NextReports Engine a free, very light, fluent api used to run your reports and charts. You need your report object, a database connection, desired format and values for your parameters if any:

FileOutputStream stream = new FileOutputStream("test.html");

In a next article “How do you use your reports?” I will introduce NextReports Server and all the benefits you have with a centralized reporting server application.



Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}