We have the following code to export a report from Crystal report 10 into PDF format. Once exported, this will get displayed in the browser, from where the user can take print out or save to system.
ostream = rd.ExportToStream(ExportFormatType.PortableDocFormat)
If Response IsNot Nothing Then
Response.Clear()
Response.Buffer = True
Response.ContentType = “application/pdf”
Response.BinaryWrite(ostream.ToArray())
Response.Flush()
End If
Above code generated huge PDFR files and caused performance issues. Sample files generated by the above code ranges from 200KB to 300KB. We have replaced the export code with ExportToHttpResponse method of crystal report and observed the reduction in file size from 200KB to 60KB.
rd.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, “”);