Hello to All,
I want to use basic jasper report utility....
But facing error as mentioned below,
please help me.....I'm beginer of JReport
import java.io.File;
import java.util.HashMap;
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.JasperReport;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.engine.util.JRSaver;
import net.sf.jasperreports.engine.xml.*;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.export.JRPdfExporter;
import net.sf.jasperreports.engine.export.JRPrintServiceExporter;
import net.sf.jasperreports.engine.export.JRPrintServiceExporterParameter;
import net.sf.jasperreports.view.JRViewer;
import net.sf.jasperreports.view.JasperDesignViewer;
public class water_bill {
public static void main(String[] args) {
new water_bill().generateReport();
}
private void generateReport() {
JasperReport jasperReport = null;
JasperDesign jasperDesign = null;
JasperPrint report = null;
try
{
//jasperDesign =JRXmlLoader.load(new File("C:/JASPER_NEW/trialJasper//trialjasper/reports/abc.java"));
jasperReport = JasperCompileManager.compileReport("C:/JASPER_NEW/trialJasper//trialjasper/reports/abc.java");
report = JasperFillManager.fillReport(jasperReport,new HashMap());
JRViewer jrViewer = new JRViewer(report);
}
catch(JRException e)
{
e.printStackTrace();
}
}
}
Error is as follow,
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:142)
at water_bill.generateReport(water_bill.java:37)
at water_bill.main(water_bill.java:25)