Having completed the tabs necessary for your report in Report Wizard, you get a draft design as below:
In the report Design window that appears, you can see the work area is partitioned into different sections, consisting of two tabs: Design and View. The Design tab indicates the design mode while the View tab causes JREngine to run the report and presents the result on the screen.
Basically, there are seven sections in a report. They are Report Header, Page Header, Group Header, Detail, Group Footer, Page Footer and Report Footer.
- Report Header
Placing fields or objects here will allow them to only be seen on the very first page of the final report.- Page Header
Objects and fields in this section will be seen once per page in the upper half of each page of the report.- Group Header
Placing fields and objects in this area will allow them to be seen once per group in the report.- Detail
Depending on how much data there is per group, fields and objects here may be seen multiple times.- Group Footer
Placing fields and objects in this area will allow them to be seen once per group in the report.- Page Footer
Objects and fields in this section will be seen once per page in the lower half of each page of the report.- Report Footer
Placing fields or objects here will allow them to only be seen on the very last page of the final report.
To add or delete a section, first move the mouse cursor to the section you want to add or delete. Next, right click to reveal a menu that lists the following commands:
- Title of the section
- Hide
- Insert Section After
- Delete
- Report Inspector
- Save Style
Select Delete, the section which the mouse cursor points to will be deleted.
Select Insert Section After, a copy of the section below the original you selected will be added afterwards.
Other ways of inserting sections:
- Click on the Insert Section button on the Edit toolbar.
- Go to the Insert menu, click Section.
For all the above methods, a box will appear if you move your mouse cursor in the design window. Place the box in a previous section of the report. This will insert a copy of that previous section right below it.
Every section is resizable. To resize a section, position the cursor over its split bar. After the cursor becomes a double-headed arrow, press the left button, drag and drop the split bar to its desired position.
You can also resize more accurately with Report Inspector. Simply highlight the section and go to Report Inspector. Find Height and Width under Geometry. You may change the area of the section by changing the value in Height and Width.
In the design mode, you can display horizontal and vertical rulers for better positioning of the objects. Selecting Show Rulers from the View menu to show the rulers.
In the View menu, on the View menu, you can see Grid Size, Show Grids and Snap to Grids.
- Grid Size
Adjust the size of the grids in the design area.
- Show Grids
Reveal or hide the grids.- Snap to Grids
Either objects will snap and lock with the grids, or you can freely move and place objects around.
Guidelines are provided for easy and accurate alignment of objects in the Design tab. To display your guidelines, you can go to the View menu and select Show Guidelines.
- Adding Guidelines
To add a vertical guideline, go to the horizontal ruler and click on it. A Guideline Handle icon should appear with the guideline. Repeat the steps to add more guidelines.
To add a horizontal guideline, go to the vertical ruler and click on it. A Guideline Handle icon should appear with the guideline. Repeat the above steps to add more guidelines.- Moving a Guideline
Drag the Guideline Handle icon to move the guideline along the design area. Release the icon to set the guideline in place.- Removing a Guideline
Drag the Guideline Handle away from the ruler and the guideline will disappear.
Click the View tab and JREngine will begin running the report. The result will be shown in the viewer. To optimize the performance, notice that JReport Designer displays report pages before they are completely generated.
In the View mode, you can see a toolbar used to go backwards or forwards in viewing your report, and also to refresh the data or stop generating the report, etc.
Below are the function expainations of the buttons on the toolbar listed one by one in sequence.
- First Page
Displays the first page of the report.- Previous Page
Displays the previous page of the report.- 3 of 7
Indicates which page out of the total pages you are viewing.- Next Page
Displays the next page of the report.- Last Page
Displays the last page of the report.- Toc
Shows the table of contents.- Drag Tool (Ctrl + T)
Drags the page up and down.
Click this button, place your mouse cursor on any blank area of the report, when the mouse cursor becomes a small hand. you can drag the page.- Zoom In Tool (Z)
Enlarges the page.- Zoom Out Tool (Shift + Z)
Reduces the page.- Refresh Data
Updates any changes you created in your data.
Note: After some modifications in the design mode, you will find the view mode does not make the changes and the report is shown very quickly. This means you need to use this button to re-run your report.- Refetch Data
Re-fetches data to re-run the report.- Stop
Press the it if you want JReport to stop the report generation.
You can sort the records in the report dynamically in the report view mode. To do this, move the mouse cursor to the field you want to sort, right click and select the option you want on the pop-up menu.
Select Sort Ascending, the records displayed will be sorted in an ascending order (A, B, C). Selecting Sort Descending, the records will be sorted in a descending order (C, B, A).
You can drill down on Aggregate level fields in your report. Drilldown is made possible where there is a summary for a group. For example, we create a report grouped by Customer Region, and create a group summary on the Annual Sales. When you view the report, point your mouse at the total annual sales for a region, and click it. The drill-down report is displayed.
Usually in this case we will hide the detail section and only show it in the drill-down report. To do so, select the detail section, and go to Report Inspector. Set its Invisible property to true. Then view the report again, and it will show without the details.
Place the mouse on the Annual Sales summary. When the small hand appears, click it, and the drill-down report will be displayed.