Visual Studio 2003 and Crystal Reports

D

David Lozzi

Howdy,

I have a web application that is using Crystal Reports which get converted
to PDF for viewing. Works great on the production server. I have since
installing the app reloaded my development machine and now they don't
display on my machine. I don't get any errors, just a plain white screen.
Its been about 2 years since I worked on this application and now they need
updates and I forget how to view a crystal report as a PDF on my
workstation. Please help!

The script I'm using to convert to PDF is

Dim crReport As New rptCustomerQuote

Dim woid As Integer = Request("WOID")

Dim ds As New DataSet

Dim conn As New SqlConnection(ConnectionString)

Dim adap As New SqlDataAdapter("cp_FrmCustomerQuote", conn)

With adap

..SelectCommand.CommandType = CommandType.StoredProcedure

..SelectCommand.Parameters.Add(New SqlParameter("@WOID", woid))

End With

adap.Fill(ds, "cp_FrmCustomerQuote")

crReport.SetDataSource(ds)



'Change the output stream of the current form

Dim strStream As New
System.IO.BinaryReader(crReport.ExportToStream(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat))

Response.ClearContent()

Response.ClearHeaders()

Response.ContentType = "application/pdf"

Response.BinaryWrite(strStream.ReadBytes(strStream.BaseStream.Length))

Response.Flush()

Response.Close()

conn.Close()



Thanks,

David Lozzi
 
D

David Lozzi

Thanks for the link, however I have that part taken care of. Like I said, it
works great on the server but it is not doing anything on my workstation.


sloan said:
http://scottonwriting.net/sowblog/posts/2148.aspx

There is a tibbit there about streaming a Crystal Report To PDF.....




David Lozzi said:
Howdy,

I have a web application that is using Crystal Reports which get
converted
to PDF for viewing. Works great on the production server. I have since
installing the app reloaded my development machine and now they don't
display on my machine. I don't get any errors, just a plain white screen.
Its been about 2 years since I worked on this application and now they need
updates and I forget how to view a crystal report as a PDF on my
workstation. Please help!

The script I'm using to convert to PDF is

Dim crReport As New rptCustomerQuote

Dim woid As Integer = Request("WOID")

Dim ds As New DataSet

Dim conn As New SqlConnection(ConnectionString)

Dim adap As New SqlDataAdapter("cp_FrmCustomerQuote", conn)

With adap

.SelectCommand.CommandType = CommandType.StoredProcedure

.SelectCommand.Parameters.Add(New SqlParameter("@WOID", woid))

End With

adap.Fill(ds, "cp_FrmCustomerQuote")

crReport.SetDataSource(ds)



'Change the output stream of the current form

Dim strStream As New
System.IO.BinaryReader(crReport.ExportToStream(CrystalDecisions.[Shared].Exp
ortFormatType.PortableDocFormat))

Response.ClearContent()

Response.ClearHeaders()

Response.ContentType = "application/pdf"

Response.BinaryWrite(strStream.ReadBytes(strStream.BaseStream.Length))

Response.Flush()

Response.Close()

conn.Close()



Thanks,

David Lozzi
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top