StreamCorruptedException on fillReportToFile

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
2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 16 years 10 months ago

0 Answers:

No answers yet
Feedback