2001 JI Open Discussion Posted August 13, 2006 Share Posted August 13, 2006 By: yelena - yelena13 Problems creating PDF sample 2001-12-05 17:23Hello, I was able to compile the sample. However, when I tried to create PDF file I got errors below. Please, help. java -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXP arser JasperReportsTestApp -Tpdf -FFirstJasper.jasper java.lang.ClassCastException: dori.jasper.engine.JasperDesign at dori.jasper.engine.JasperManager.printReportToPdfFile(JasperManager.jav a:124) at JasperReportsTestApp.main(JasperReportsTestApp.java:115) By: Lou Farho - loufarho RE: Problems creating PDF sample 2002-01-29 13:00I am receiving the following error when printing to PDF C:jakartajaspersample>C:jdk1.3.1_01binjava.exe -classpath ./;jasperreports -0.2.1.jar;C:jdk1.3.1_01/lib/tools.jar;commons-beanutils.jar;commons-collection s.jar;commons-digester.jar;xerces.jar;itext.jar -Dorg.xml.sax.driver=org.apache. xerces.parsers.SAXParser JasperReportsTestApp -Tpdf -FFirstJasper.jrprint java.lang.RuntimeException: Inconsistent writers. Are you mixing two documents? at com.lowagie.text.pdf.PdfContentByte.add(PdfContentByte.java:175) at dori.jasper.engine.JRPrinterPDF.printReport(JRPrinterPDF.java:84) at dori.jasper.engine.JRPrinterPDF.printReport(JRPrinterPDF.java:45) at dori.jasper.engine.JasperManager.printReportToPdfFile(JasperManager.j ava:152) at dori.jasper.engine.JasperManager.printReportToPdfFile(JasperManager.j ava:129) at JasperReportsTestApp.main(JasperReportsTestApp.java:114) Any Comments will be appreciated! Lou Farho By: Teodor Danciu - teodord RE: Problems creating PDF sample 2002-01-31 00:30 Hi, Lou, What version of iText are you using? Thanks, Teodor By: Michelle Popovits - mpopovits RE: Problems creating PDF sample 2002-01-31 13:03I am also trying to get this working. I get this message: C:jaspersample>C:jdk1.3.1binjava.exe -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser J asperReportsTestApp -Tpdf -FFirstJasper.jrprint java.lang.RuntimeException: Inconsistent writers. Are you mixing two documents? at com.lowagie.text.pdf.PdfContentByte.add(PdfContentByte.java:175) at dori.jasper.engine.JRPrinterPDF.printReport(JRPrinterPDF.java:105) at dori.jasper.engine.JRPrinterPDF.printReport(JRPrinterPDF.java:66) at dori.jasper.engine.JasperManager.printReportToPdfFile(JasperManager.java:206) at dori.jasper.engine.JasperManager.printReportToPdfFile(JasperManager.java:177) at JasperReportsTestApp.main(JasperReportsTestApp.java:115) By: Teodor Danciu - teodord RE: Problems creating PDF sample 2001-12-05 22:46 Hi, Before you can generate a PDF file you have to fill your compiled report design with data. And you do that by calling the fillReportXXX() methods of the dori.jasper.engine.JasperManager class. In the sample, there is a batch file available for the job called taskFill.bat. This operation will produce a .jrprint file that will contain your ready to print report. To view it you ca use taskView.bat (dori.jasper.view.JasperViewer class) or you can generate a PDF file for it using the taskPrintPDF.bat (printReportToPdfFile method in dori.jasper.engine.JasperManager). You got the error because you supplied your compiled report design to the PDF generating method (the .jasper file), instead of the filled report (the .jrprint file). Good luck! Teodor By: Lou Farho - loufarho RE: Problems creating PDF sample 2002-01-31 14:32Version 0.81 After downloading the source for JasperReport and iText, I was able to debug my exception. I submitted a bug report to iText for the PdfContentByte.add() method. It is logged as #510813 and #510560 It appears that iText has fixed their code. Please review the thread there. Sorry, I should have updated my post yesterday. Lou By: Michelle Popovits - mpopovits What version? 2002-01-31 16:44What version of iText fixes this? I downloaded the iText.jar today and had this problem. -Michelle By: Teodor Danciu - teodord Graphic and PdfContentByte in iText 2002-01-31 23:37 Hi, Lou, Thank you for identifying the problem. I'll make the appropriate adjustments in JasperReports in order to eliminate the use of Graphic object since they said that it is somehow deprecated in iText. Thanks, Teodor 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