2005 IR Help Posted August 27, 2006 Share Posted August 27, 2006 By: Jay - riverbaobao StreamCorruptedException 2004-03-25 00:14 I am a beginner of JasperReport , i try to run the datasource example , i can compile it ,but when i tyr to run it , i got a Exception "java.io.StreamCorruptedException:invalid stream header" when call the method JasperFillManager.fillReportToFile(fileName, parameters, new CustomDataSource()); but this file is a copy of the original xml file , i didn't change anything , help ~~~~~~~~~ By: Chuck Deal - cdeal RE: StreamCorruptedException 2004-03-25 05:04 You don't fill an XML file. You complie the XML file into the .jasper file. Then you can fill the .jasper file. By: yoshimit - yoshimit RE: StreamCorruptedException 2004-11-17 10:22 Ok. I having the same problem. The difference is that I'm filling the .jasper file... look: line 27 JRResultSetDataSource jrRS = new JRResultSetDataSource( rs ); line 28 Map parameters = new HashMap(); line 29 JasperFillManager.fillReportToFile("c:/backup/dug/ireport/relas/bairros.jasper", parameters, jrRS); line 30 JasperRunManager.runReportToHtmlFile("c:/backup/dug/ireport/relas/bairros.jasper", parameters, jrRS); line 31 JasperViewer.viewReport( "c:/backup/dug/ireport/relas/bairros.html", false ); The file .html (or .pdf) is created but not shown... Instead I got the exception: java.io.StreamCorruptedException: invalid stream header at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:737) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:253) at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:128) at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:106) at net.sf.jasperreports.view.JRViewer.loadReport(JRViewer.java:1249) at net.sf.jasperreports.view.JRViewer.<init>(JRViewer.java:171) at net.sf.jasperreports.view.JasperViewer.<init>(JasperViewer.java:161) at net.sf.jasperreports.view.JasperViewer.viewReport(JasperViewer.java:297) at com.provenda.relas.bairros.geraRelatorio(bairros.java:31) at com.provenda.relas.bairros.main(bairros.java:34) thank you in advance Yoshimit 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