I need Jasper Report example

Hi,I need example on how to generate Reports by using Jasper. So if any one having any link pls just send me.Thank you in advance
[150 byte] By [sumanth_dtksa] at [2007-10-2 20:57:22]
# 1

For Creating Jasper Report u need to import these packages

import net.sf.jasperreports.engine.JRException;

import net.sf.jasperreports.engine.JasperCompileManager;

import net.sf.jasperreports.engine.JasperFillManager;

import net.sf.jasperreports.engine.JasperPrint;

import net.sf.jasperreports.engine.JasperPrintManager;

public boolean compileReport()

{

try {

JasperCompileManager.compileReportToFile("path of fileName.jrxml");

}

catch (Exception e) {

System.out.println("compile exception " + fileName + ", " + e);

return false;

}

return true;

}

public JasperPrint fillReport()

{

try {

JasperPrint jasperPrint = JasperFillManager.fillReport("fileName.jasper", <parameters if u use any in Jasper Report Design else give null>, new JRFieldLevelAuditSource(data));

return jasperPrint;

} catch (JRException e) {

}

return null;

}

public void print(JasperPrint jasperPrint) {

try {

JasperPrintManager.printReport(jasperPrint, true);

} catch (JRException e)

{

e.printStackTrace();

}

}

Dinesh_Mallemalaa at 2007-7-13 23:42:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...