CrystalReport Viewer Export in asp.net

  • Thread starter Thread starter rbutch
  • Start date Start date
R

rbutch

hey guys, any idea(s) why this code would only export the first page?
it works perfectly - just if the report has multiple pages, it only exports one.
thanks for any help
ive been all over the web and this seems to be the code everyone is using.
rik

Private Sub ExportPdf()
Dim oStream As MemoryStream = New MemoryStream
oStream = oRept.ExportToStream(ExportFormatType.PortableDocFormat)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/pdf"
Response.AddHeader("content- disposition", "attachment;filename=CrystalViewer.pdf")
Response.BinaryWrite(oStream.ToArray())
Response.End()
End Sub

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
Ehh .. I figured it may help to tell you the solution as well LOL :)

You need to do attachment/download and then Response.Write(someaspx) .. the
someaspx streams out the pdf content as a single stream - then it shows up
as an HTTP download and life is good.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
__________________________________________________________
 
Back
Top