3 Replies Latest reply: Sep 19, 2010 6:28 AM by DarrylBurke RSS

    Trouble opening a serialized report (crystal) document

    843790
      Hi, we are trying to open a crystal report document as a java stream - (accd to a CR forum it isnt a CR prob so thought to try here), but receive the
      following error:

      java.io.StreamCorruptedException: invalid stream header: 25504446

      With the following code:

      public ReportClientDocument readDocumentFromStream3(String file) throws IOException, ReportSDKException, ClassNotFoundException
           {     
                
                //Open report.               
                ReportClientDocument reportClientDoc = new ReportClientDocument();               
                reportClientDoc.open(file, 0);
                
                //Export report and obtain an input stream that can be written to disk.
                ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController               ().exportReportExportFormat.PDF);
                
                ObjectInputStream ois = new ObjectInputStream(byteArrayInputStream);
                reportClientDoc.readExternal(ois);
                ois.close();
                byteArrayInputStream.close();
                //Release report.
                reportClientDoc.close();
                return reportClientDoc;