ptclin_2007 Posted May 22, 2007 Share Posted May 22, 2007 i need help! This is source code,what's wrong? InputStream input = new FileInputStream(new File("E:/report/classic.jrxml"));JasperDesign design = JRXmlLoader.load(input);JasperReport report = JasperCompileManager.compileReport(design);Map parameters = new HashMap();parameters.put("ReportTitle", "PDF JasperReport");//JasperPrint print = JasperFillManager.fillReport(report, new HashMap(), conn);JasperPrint print = JasperFillManager.fillReport(report,parameters, conn);JasperViewer.viewReport(print);OutputStream output = new FileOutputStream(new File("E:/report/classic.pdf"));JasperExportManager.exportReportToPdfStream(print, output); JasperViewer.viewReport(print) can work rightly,but exportReportToPdfStream(..) will cause error Exception in thread "main" java.lang.NoClassDefFoundError: com/lowagie/text/DocumentException at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfStream(JasperExportManager.java:162) at dest.ScannerDemo2.main(ScannerDemo2.java:40) Link to comment Share on other sites More sharing options...
Capricorn Posted May 22, 2007 Share Posted May 22, 2007 I think that means you don't have iText.jar on your classpath. Link to comment Share on other sites More sharing options...
alexjonk Posted August 3, 2007 Share Posted August 3, 2007 Hi there I had the same problem even with iText-2.04.jar in the classpath, didn't work. The Solution! try an older version i've used 1.3.6 that did the trick! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now