CR XI Rel 2 Upgrade - now no PDFs
I upgraded my workstation with CR XI Rel 2 and when I opened my Visual Studio 2003 web project, VS insisted on updating my Crystal Reports references. Then I had to update the web server with the CR XI Rel 2 .NET Server Install.
Tried to run the web app which serves up a PDF and got a couple of errors regarding unable to find CrystalDecisions.ReportAppServer.CommLayer and CrystalDecisions.ReportAppServer.DataSetConversion . Added references for those assemblies and no more errors.
HOWEVER, now the PDFs don't get served up either. Just get a blank page.
I haven't bumped the app up to VS 2005 as I want to get CR working first before I tackle converting to the new format. The web app is registered to run under ASP.NET 2.0 however, even though it is still being developed on VS 2003, thus no .NET 2.0 specific calls.
A copy of the code that worked before the CR XI Rel 2 update follows. It's sole mission is that if a user browses to this page, it takes two session variables, passes them in as parameters and outputs a PDF of the report. Worked fine until this morning's upgrade issues. What am I missing?
Thanks -- Doug
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim _email As String
Dim _ShipId As String
Dim _ShipName As String
_email = Session("email")
_ShipId = Session("ShipId")
_ShipName = Session("ShipName")
If (_email = "" Or _ShipId = "" Or _ShipName = "") Then
Response.Redirect("missingparams.aspx")
End If
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String
Dim myReport As New Section1_rpt
myExportFile = "D:\Inetpub\wwwroot\projects\PrintOuts\" & Session("ShipID") & "_Section01_" & Date.Now().Year.ToString & _
Date.Now().Month.ToString & Date.Now().Day.ToString & Date.Now().Hour.ToString & _
Date.Now().Minute.ToString & Date.Now().Second.ToString & ".pdf"
myDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = myReport.ExportOptions
myReport.SetDatabaseLogon("*blanked out*", "*blanked out*")
myReport.SetParameterValue("ShipID", Session("ShipID"))
With myExportOptions
.DestinationOptions = myDiskFileDestinationOptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
myReport.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(myExportFile)
Response.Flush()
Response.Close()
System.IO.File.Delete(myExportFile)
End Sub
|