Creating a connection with IReport ?

This is one of the easiest blog post I've ever noted down @ 'notesofharsha'.

You may have already used IReport (Jasper Reporting Software) for reporting purposes of your java application.

If yes, skip this post. This is like letter 'A' for an Advanced English Learner.

If no, & if you're just getting to know IReport. This is a way to go. The very first step of IReport is creating a connection with the database. Here I use MYSQL database.

1. Launch IReport application.


 2. Click 'New Connection' icon, blow the menu bar. (Plug in to the DB Icon)





3. Then, Click button 'New' in the pop up box.


3. Select 'Database JDBC Connection'. (this applies if you're jasper reporting for your java application)


4. Way to go. Then, under JDBC URL: jdbc:mysql://localhost/(Your Database Name) set the name of your database that you're currently attempting to connect. Username is for your username, may be it's root then type root under username & password is blank in default, but you can make your own settings here and don't forget to tick save password.

Most importantly, set a name for your connection so that you can use it constantly.



5. Test the connection to check whether all the settings are in order.





If you see a pop up box appears like in the screen shot. You've already done it alright. Click 'Save' in order to proceed.

6. Tick the default tick under the connection name you set. So that you can use this connection every time you launch your application.



Then, click close & you're ready to go. Enjoy IReporting !

No comments: