ActiveReports for .NET 2.0 Visual Studio .NET 2005 Support

Started by cjorgensen at 11-08-2005 3:04 PM. Topic has 8 replies.

Print Search
Sort Posts:    
   11-08-2005, 3:04 PM
cjorgensen is not online. Last active: 12/1/2011 6:37:44 AM cjorgensen

Top 200 Posts
Joined on 09-30-2003
Edmonds, Washington
Posts 49
Stream an PdfExport doesn't work
I am not sure if this is a known problem or not, but if I do a pdf export it exports to a file fine.  But if I stream it out it just opens a blank browser window and nothing shows up.  It is an empty source.

This is the code I am using: (I got from your sample..)

' Tell the browser this is a PDF document so it will use an appropriate viewer.
' If the report has been exported in a different format, the content-type will

' need to be changed as noted in the following table:

' ExportType ContentType

' PDF "application/pdf" (needs to be in lowercase)

' RTF "application/rtf"

' TIFF "image/tiff" (will open in separate viewer instead of browser)

' HTML "message/rfc822" (only applies to compressed HTML pages that includes images)

' Excel "application/vnd.ms-excel"

' Excel "application/excel" (either of these types should work.

' Text "text/plain"

Response.Clear()

Response.ClearHeaders()

Response.ClearContent()

Response.ContentType = "application/pdf"

' IE & Acrobat seam to require "content-disposition" header being in the response. If you don't add it, the doc still works most of the time, but not always.

'this makes a new window appear: Response.AddHeader("content-disposition","attachment; filename=MyPDF.PDF");

Response.AddHeader( "content-disposition", "inline; filename=MyPDF.PDF" )

' Create the PDF export object

Dim pdf As New PdfExport

' Create a new memory stream that will hold the pdf output

Dim memStream As New System.IO.MemoryStream()

' Export the report to PDF:

pdf.Export(rpt.Document, memStream)

pdf.Export(rpt.Document, "C:\Test\file.pdf" )

' Write the PDF stream out

Response.BinaryWrite(memStream.ToArray())

' Send all buffered content to the client

Response.End()


The export to file works fine.

Thanks,
Cory Jorgensen
Bitco Software


Thank you,

Cory Jorgensen
Bitco Software
   Report 
   11-08-2005, 3:25 PM
rakeshjani is not online. Last active: 5/22/2007 2:14:29 AM rakeshjani

Top 50 Posts
Joined on 08-28-2004
Columbus,Ohio
Posts 362

DDStaff
Re: Stream an PdfExport doesn't work
Sir,
       Try to use this code.

Private Sub Page_Load(ByVal sender As Object , ByVal e As System. EventArgs ) Handles _

MyBase.Load

Dim m_stream As New System.IO.MemoryStream()

Dim rpt As New rptCustEx()

rpt.Run()

Me.PdfExport1.Export(rpt.Document, m_stream)

m_stream.Position = 0

Response.ContentType = "application/pdf"

Response.AddHeader( "content-disposition" , "inline; filename=MyExport.pdf" )

Response.BinaryWrite(m_stream.ToArray())

Response.End()

End Sub


 

Rakesh Jani

   Report 
   11-08-2005, 3:47 PM
cjorgensen is not online. Last active: 12/1/2011 6:37:44 AM cjorgensen

Top 200 Posts
Joined on 09-30-2003
Edmonds, Washington
Posts 49
Re: Stream an PdfExport doesn't work
I still get a blank screen.

This code that I have works fine with my other applications in VS 2003 and ActiveReports 1.0

Thanks,
Cory Jorgensen
Bitco Software
Thank you,

Cory Jorgensen
Bitco Software
   Report 
   11-08-2005, 4:09 PM
cjorgensen is not online. Last active: 12/1/2011 6:37:44 AM cjorgensen

Top 200 Posts
Joined on 09-30-2003
Edmonds, Washington
Posts 49
Re: Stream an PdfExport doesn't work
Ok,  here is what I did.

I created a new web project, created a new report and then the code works and the report is created and streamed as a PDF.

For some reason it isn't streaming my reports imported from VS 2003 using AR V1.

Why would it create the PDF file without any problem but not stream it?

Thanks,
Cory Jorgensen
Bitco Software
Thank you,

Cory Jorgensen
Bitco Software
   Report 
   11-08-2005, 4:29 PM
rakeshjani is not online. Last active: 5/22/2007 2:14:29 AM rakeshjani

Top 50 Posts
Joined on 08-28-2004
Columbus,Ohio
Posts 362

DDStaff
Re: Stream an PdfExport doesn't work
which version of acrobat reader do you have on your machine?
Rakesh Jani

   Report 
   11-08-2005, 4:45 PM
cjorgensen is not online. Last active: 12/1/2011 6:37:44 AM cjorgensen

Top 200 Posts
Joined on 09-30-2003
Edmonds, Washington
Posts 49
Re: Stream an PdfExport doesn't work
Adobe Acrobat 6.0 Standard
Thank you,

Cory Jorgensen
Bitco Software
   Report 
   11-08-2005, 4:51 PM
cjorgensen is not online. Last active: 12/1/2011 6:37:44 AM cjorgensen

Top 200 Posts
Joined on 09-30-2003
Edmonds, Washington
Posts 49
Re: Stream an PdfExport doesn't work
Good Call.  I tried it on a machine with Acrobat 6.0 Reader and it works fine.

It doesn't seem to work with Acrobat 6.0 Standard edition.  The older version of Active Reports 1 works fine with it.

Now What?

Cory Jorgensen
Bitco Software
Thank you,

Cory Jorgensen
Bitco Software
   Report 
   11-09-2005, 12:30 PM
rakeshjani is not online. Last active: 5/22/2007 2:14:29 AM rakeshjani

Top 50 Posts
Joined on 08-28-2004
Columbus,Ohio
Posts 362

DDStaff
Re: Stream an PdfExport doesn't work
Sir,
      I will let you know what i find. I am using 7.0.5.
Rakesh Jani

   Report 
   11-10-2005, 6:38 PM
dagnar7 is not online. Last active: 4/12/2006 5:57:38 PM dagnar7

Top 500 Posts
Joined on 10-04-2003
Posts 25
Re: Stream an PdfExport doesn't work
i've seen similar behavior dealing with acrobat 6.  the hack i've discovered is if you append a "*.pdf" onto the query string the browser will be forced to launch the acrobat reader.  ex: "http://streamPage.aspx?foo.pdf"

   Report 
GrapeCity » Forum Archives » ActiveReports f... » Stream an PdfExport doesn't work

Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.