Jasper iReport's Datasources include
- CSV File
- Mondrian OLAP ,
- EJB, and
- Microsoft Excel.
To add a Datasource to iReport, making it available during report creation, Press the cylinder database icon in the top toolbar.
|Manage Datasource Icon on iReport Toolbar|
If you want to create a MySQL Datasource, press the New button. When the Datasource dialog is displayed, select "Datasource JDBC Connection" and next. Fill out the dialog as follows.
|MySQL Datasource in iReport|
If you're not familiar with JDBC URLs, there is a Wizard that will help form the correct syntax. Enter the host and database identifier and press "Wizard". If you're running MySQL on a different port than the default 3306, add the port number after the hostname, separated by a colon.
Test the Datasource and Save, optionally saving the password. Since the password is stored in the clear, it would be a good idea to create a special database account for reporting.
Once the Datasource is created, it can be used in iReport for creating reports. In iReport, you write queries (SQL in this case) against the Datasource and format the result set using the Designer.