Selasa, 16 November 2010

Instant Guide to Jasper IReport

A short guide for designing java reporting with jasper ireport :
  1. Open your ireport (it can be installed version or portable ).


  1. Create new report file.
    See the ireport menu tool bar, you will see “File, Edit, View Format, Preview, Window, Tools, and Help” menu. For create new report template file click “File” menu than the “File” menu option will appear. Choose “new” option.



3. Choose report template.
New file popup window appear. There are many templates that can be used. Choose any template that suitable your report needs. In this example I use “Blank A4” template.

  1. Fill report name.
    New report name popup window appear. Fill your report name, folder location, and where to put generated jrxml file. Click next.


5. Finish report template.
Report tempate finish window appear. Click finish if everything has been filled well, other wise click back and following the step before.



6. Show “Palette” tool bar.
By default, pallete is hidden. We must show it for using label, textfield and the others.



7. Pallete tool bar appear in the right top window.


8. Create title using “static text” component (label).
From the pallete window drag “static text” to title band. Write your report title.



9. Create report column name at column header band using “static text” component.
Drag the “static text” to column header band as many as your report columns. Arrange their column width, height by drag the box. Right click → Padding And Border for setting the padding and border property.




10. Give value to “line width” and “padding” property.
After right click → Padding And Border, a popup window will be appeared. Fill the value of padding and line width as you want.


11. Create report content by using text field component in detail band.
    Drag “text field” componet to detail band as many as your report columns. Arrange their column width, height by drag the box. Right click → Padding And Border for setting the padding and border property.


12. Omit the unused band.
Colum Footer, Page Footer, Summary can be omitted when unused. It can be done by dragging the border line of the band. Put the cursor of the bottom line of the band then drag to the top till meet the bottom line of the above band.
See the final report template.



The report template is done. We can get the jrxml file in the location specified at point 4. Now, we can use the report template to generate the report by filling the data and view it.

Tidak ada komentar:

Posting Komentar