PC Review


Reply
Thread Tools Rate Thread

CrystalReport Viewer Export in asp.net

 
 
rbutch@coair.com
Guest
Posts: n/a
 
      20th Dec 2005
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...
 
Reply With Quote
 
 
 
 
Sahil Malik [MVP C#]
Guest
Posts: n/a
 
      25th Dec 2005
PDFs are sent using HTTP 206 Partial Content. You cannot send a pdf in the
manner you specify below.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
__________________________________________________________


"rik butcher" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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...



 
Reply With Quote
 
Sahil Malik [MVP C#]
Guest
Posts: n/a
 
      25th Dec 2005
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.ma.../13/63199.aspx
__________________________________________________________
"rik butcher" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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...



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export CrystalReport to HTML David Dvali Microsoft ASP .NET 0 17th Aug 2005 10:03 AM
Export CrystalReport to Excel crjunk Microsoft ASP .NET 0 11th Oct 2004 09:32 PM
How to know whether a user has printed a report while using crystalreport viewer Ray Microsoft VB .NET 0 17th Sep 2004 09:41 AM
OpenFileDialog And CrystalReport Viewer Reny J Joseph Thuthikattu Microsoft VB .NET 0 2nd Jun 2004 03:11 AM
Problem in crystalreport viewer Pattabi Microsoft ASP .NET 3 21st Nov 2003 02:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:45 AM.