2002 JI Open Discussion Posted August 17, 2006 Share Posted August 17, 2006 By: vineet bhatia - vineetb StreamCorruptedException on fillReportToFile 2003-02-10 14:49 When I do JasperFillManager.fillReportToFile(fileName, null, getConnection()); I get this exception. java.io.StreamCorruptedException: InputStream does not contain a serialized object at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:844) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:163) at dori.jasper.engine.util.JRLoader.loadObject(JRLoader.java:119) at dori.jasper.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:101) at samples.invoice_report.InvoiceReportApp.main(InvoiceReportApp.java:32) NESTED BY : dori.jasper.engine.JRException: Error loading object from file : InvoiceReport1.xml at dori.jasper.engine.util.JRLoader.loadObject(JRLoader.java:126) at dori.jasper.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:101) at samples.invoice_report.InvoiceReportApp.main(InvoiceReportApp.java:32) The InvoiceReport1.jasper file is generated. Here is my XML file - <?xml version="1.0"?> <!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"> <jasperReport name="InvoiceReport1" columnCount="2" printOrder="Vertical" pageWidth="595" pageHeight="842" columnWidth="270" columnSpacing="15" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30" isTitleNewPage="false" isSummaryNewPage="false"> <pageHeader> <band height="45"> <rectangle> <reportElement x="0" y="0" width="555" height="40" mode="Transparent"/> <graphicElement stretchType="NoStretch"/> </rectangle> <staticText> <reportElement x="0" y="0" width="555" height="25"/> <textElement textAlignment="Center"> <font size="18"/> </textElement> <text>Vineet Bhatia</text> </staticText> </band> </pageHeader> </jasperReport> By: Teodor Danciu - teodord RE: StreamCorruptedException on fillReportToFile 2003-02-10 23:30 Hi, When filling a report, you have to supply the .jasper file, not the .xml file. I hope this helps. Teodor By: vineet bhatia - vineetb RE: StreamCorruptedException on fillReportToFile 2003-02-11 18:56 Yup, this was not too clear from the document but I saw from the build.xml of the sample. Thanks. - vineet 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