Create First Report (.jrxml) Via IReport
From SimIT Wiki
Prepare Database
1. Login mysql database via PHPMyAdmin or other mysql manipulation tool
2. Create a database name db1, which is accessible by user1 and password='PASS'
3. In database, create a table call table1 with column: record_id INT, name varchar(40), contacts varchar(20), address text
4. Manually insert some data into database.
Create Project and Empty Report
1. Start Netbeans
2. Create new PHP project via File -> New Project -> PHP -> PHP Application -> change the path to suit your web server folder
3. Press finish
4. Create new iReport via File -> New File -> Report -> Empty Report
5. Name the report as report1 and you will notice that the actual file name is report1.jrxml
6. Your blank report is created
Tailor Made New Report
1. At Netbeans toolbar, click Report Datasources icon
2. Press New and choose Database JDBC connection -> Next
3. Fill proper name into column Name (I use db1), fill in proper value at Server Address, Database, Username, Password
4. Click Save password and press Wizard
5. Press 'Test' button, if you can connection establish successfully can press Save button, otherwise your shall check step 3 again
6. In Connections / Datasources window you shall see new record, you can close it down
7. Choose your database connection beside icon 'Report Datasources', in my case I'll choose db1
8. At the blank report, re-size band Title, Column Header, Column Footer and Summary until height=0
9. From the palette toolbox at the right side, drag 1 static text into page header, change the text as 'Report 1'
10.Press icon on the right of button 'Preview' to edit SQL statement for this report
11.You can type proper SQL here or click 'Query Designer' button to edit the SQL via GUI mode. Here my SQL text is 'SELECT * FROM table1'
12.If everything going well you will see list of field appear at bottom of this windows, press OK
13.At the left side, focus to 'Report Inspector' open out item Fields, drag item inside 1 by 1 to Detail 1 band at the report
14.Finally, from Palette (At the right) drag 'Page X or Y' to Page Footer band
15.Click button 'Preview' on top of report to see the result
16.Now your report is done

