Call iReport from Java Application

iReport Tutorial: Call iReport from Java Application

Reports designed by iReport can be called/ viewed/ embedded/ included in Java application in various ways. A sample coding is given below. Before compiling and running this code the jar files located in the lib folder of iReport installation folder must be included in the classpath.

The sample code shown below uses JFrame to view the report. You can view the report in JInternalFrame or JPanel very easily just by inheriting JInternalFrame or JPanel respectively instead of extending JFrame.

The class below has two constructors. The default constructor can be used for reports without any parameter. The second one can be used for parameterized report. The parameters should be stored in a HashMap object as the key and value pairs. The key will be the name of the parameter in the report and the value will be the variable where the input is stored.

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

What is 14 + 2 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)