In the past 2 entries (Part I and Part II) we learnt how to develop a basic report and how to fill it with data from a database with a jdbc connector. Now we will learn how to call a report from within a Java application and how to set some basic parameters. The most important thing when running your reports from within a java application is to have all the necessary jar libraries available from your classpath. The basic ones for running the sample report will be commons-logging-*.jar, commons-collections-*.jar, jasperrerports-*.jar and yourJDBCconnector.jar. All of them (except the jdbc connector) […]

Getting started with JasperReports // Printing reports from your java ...

This is the second part of a series of articles to get people started with JasperReports. In the second part I’ll explain how to access your database to run simple queries and show them in a very simple report created with iReport. The first thing we need to do to get moving is to have iReport ready. So if you haven’t got it installed do so. Next step is to have the database driver in your iReport library folder. This means that you will need a jdbc jar packaged driver copied to the ./lib/ directory of iReport’s base folder. This […]

Getting started with JasperReports // JDBC connections (Part II)

Jasper Reports is in my opinion by far the best report engine available for Java, even more, it’s open source! In the project page there is enough information available to build simple and some advanced reports. If you need more help you can buy some guides at the project’s owner commercial page JasperSoft There is also technical support available to be purchased. Today I’ll show you how to choose a printer programmatically. [crayon-59ebb79b3e134819829273/] In the above code you can see how to accomplish our purpose. The first part of all is generating our JasperPrint, this is common to all methods […]

Choosing a printer programmatically in Jasper Reports