I spent almost an hour trying to remember how to achieve this. To have this readily available in the future, thus this “documentation”.
Software Applications used:
a. MySQL Server 5.6.11
b. iReport 2.0
1. Install MySQL Server, create a connection profile in iReport, and make profile the default connection
2. Use a simple SQL Select statement for the main report
3. Create a subreport and create 3 parameters
4. Do not put any SQL Select statement on the subreport
5. Make sure the data types match with that of passed arguments
6. Main Report and Subreport
7. Configure subreport on the main report
8. On the subreport, make sure “When no data” is set to “All sections, no detail”
9. Compile reports
10 On the iReport, run the main report via Execute (with active connection) command. Make sure SUBREPORT_DIR points to the path where the compiled reports are.