CrystalReport Viewer Export in asp.net

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...
 
S

Sahil Malik [MVP C#]

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
__________________________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top