Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Export into pdf raise an error?

Hai to all,

I'm using Crystal Report 11.5, Asp.net2.0-C#.

I dynamically bind some records to the report document. Now i write the code to export the data into pdf file.

BindEveryThing();

MemoryStream oStream; // using System.IO

oStream = (MemoryStream)

boReportDocument.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);

Response.Clear();

Response.Buffer= true;

Response.ContentType = "application/pdf";

Response.BinaryWrite(oStream.ToArray());

HttpContext.Current.ApplicationInstance.CompleteRequest();

The problem is after the above code reached

i'm getting two errors as

Adobe Reader cannot open CA2V0915.pdf because it is either not a supported file type or because the file has been damaged (for example it was sent as an email attachment and wasnt correctly decoded

Threre was an error openning this document Acrobat cannot open this file because there is a modal dialog open.

Experts please help me solve this problem>

Thanks in advance.

Not what you were looking for? View more on this topic or Ask a question