A Simple Report System
[Previous] [Main] [Next]

A Simple Report System

The third tab called "Reports" bring up this screen. Normally it would not have the Message box in front of it.


sqlwhere_selectreport.png

When you click on the NEW button the message box shown above appears. It tells you how the report system works. (JGuiGen is using JFreeReports and the pdf manual is included with JGuiGen.)

In order to get the report you want you need to do the following things. You will use the NOTES column to remind yourself what needs to be set up before you click on the EXECUTE button.

1. Run a query that selects just the rows you want. Usually you would save this query.

2. If you want the records sorted in the report you will need to click on the column header for the column you want to sort the records on.

3. When you create a report you need to modify the JTable into to move the columns you want in the
report to the left side of the screen. You can click on column headers and drag the columns left or right. You will also need to resize some of the columns to show the data to the best advantage. You do this by clicking on the edge of a column hearer and dragging the edge. (BTW. If you exit the Edit Screen after having reordered columns and resized them, JGuiGen will remember this setting and use when you open the screen again. - LEAVE THE ID IN THE LEFT MOST COLUMN for now.)

4. Just over the message box you can see the empty row that is being created. Click on the REPORT TITLE field and enter a title.

   You can leave the report so that only you can see it or your change the USERS column to "ALL USERS".

   Click on the NUMBER OF COLUMNS column to tell it how many columns to include in your report.

   In the TEMPLATE column you will enter the name of an xml file to hold the description of this report. JGuiGen will create this file.

   In the NOTEs column you will describe the filter and sort order used.

5. When you done press the EXECUTE button.

Here is a simple sample:

sqlwhere_samplereport.png


   Note: JFreeReports is capable of generating much more complicated reports. You can read the mnual and manually modify the generated template file in order to get things like column totals that break on departments.

Once a report has been created, you can click on the row you want and click on EXECUTE. The report will appear. NOTE: You must filter and sort the JTable before you run the report or you will get all records sorted by ID number.