I made one jasper report using iReport 3.7.4 version, now i have to use that or call that report in my java application where i am using servlets, jsp and strut
Best solution (For better performance as well), will be calling a compiled report.
you can see the example below
import java.io.IOException;
import java.util.HashMap;
import net.sf.jasperreports.engine.JREmptyDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
public class PdfFromJasperFile {
public static void main(String[] args) throws JRException, IOException {
JasperPrint jasperPrint = JasperFillManager.fillReport("report.jasper", new HashMap(),
new JREmptyDataSource());
JasperExportManager.exportReportToPdfFile(jasperPrint, "sample.pdf");
}
}