Categories: TutorialsData

iReport in NetBeans

2 min read

Creating different types of reports inside the NetBeans IDE

The first step is to download the NetBeans IDE and the iReport plugin for this. The iReport plugin for NetBeans is available for free download at the following locations: https://sourceforge.net/projects/ireport/files or http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=4425

After downloading the plugin, follow the listed steps to install the plugin in NetBeans:

  1. Start the NetBeans IDE.
  2. Go to Tools | Plugins.
  3. Select the Downloaded tab.
  4. Press Add Plugins….
  5. Select the plugin files. For iReport 3.7.0 the plugins are: iReport-3.7.0.nbm, jasperreports-components-plugin-3.7.0.nbm, jasperreportsextensions-plugin-3.7.0.nbm, and jasperserver-plugin-3.7.0.nbm. After opening the plugin files you will see the following screen:
  6. Check the Install checkbox of ireport-designer, and press the Install button at the bottom of the window. The following screen will appear:
  7. Press Next >, and accept the terms of the License Agreement.
  8. If the Verify Certificate dialog box appears, click Continue.
  9. Press Install, and wait for the installer to complete the installation.
  10. After the installation is done, press Finish and close the Plugins dialog. If the IDE requests for a restart, then do it. Now the IDE is ready for creating reports.

Creating reports

We have already learnt about creating various types of reports, such as reports without parameters, reports with parameters, reports with variables, subreports, crosstab reports, reports with charts and images, and so on. We have also attained knowledge associated with these types of reports. Now, we will learn quickly how to create these reports using NetBeans with the help of the installed iReport plugins.

Creating a NetBeans database JDBC connection

The first step is to create a database connection, which will be used by the report data sources. Follow the listed steps:

  1. Select the Services tab from the left side of the project window.
  2. Select Databases.
  3. Right-click on Databases, and press New Connection….
  4. In the New Database Connection dialog, set the following under Basic setting, and check the Remember password checkbox:

Option

Value

Driver Name

MySQL (Connector/J Driver)

Host

localhost

Port

3306

Database

inventory

User Name

root

Password

packt

  1. Press OK. Now the connection is created, and you can see this under the Services | Databases section, as shown in the following screenshot:

Creating a report data source

The NetBeans database JDBC connection created previously will be used by a report data source that will be used by the report. Follow the listed steps to create the data source:

  1. From the NetBeans toolbar, press the Report Datasources button. You will see the following dialog box:
  2. Press New.
  3. Select NetBeans Database JDBC connection, and press Next >.
  4. Enter inventory in the Name field, and from the Connection drop-down list, select jdbc:mysql://localhost:3306/inventory [root on Default schema].
  5. Press Test, and if the connection is successful, press Save and close the Connections / Datasources dialog box.

Packt

Share
Published by
Packt

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago