Dim oRpt As New rptMembers replace rptMembers with the actual name of your report.
Try The following try catch statement is responsible for generating the report in a .pdf format.
Dim crLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
crLogonInfo = oRpt.Database.Tables(0).LogOnInfo
crLogonInfo.ConnectionInfo.ServerName = "localhost"
crLogonInfo.ConnectionInfo.UserID = "sa"
crLogonInfo.ConnectionInfo.Password = "231168"
oRpt.Database.Tables(0).ApplyLogOnInfo(crLogonInfo)
Dim myExportOptions As CrystalDecisions.Shared.ExportOptions
Dim myDiskFilesDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
Dim myExportFile As String
myExportFile = "C:\temp\PDF " & Session.SessionID.ToString & ".pdf"
myDiskFilesDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions
myDiskFilesDestinationOptions.DiskFileName = myExportFile
myExportOptions = oRpt.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFilesDestinationOptions
.ExportDestinationType = .ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
oRpt.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(myExportFile)
Response.Flush()
Response.Close()
System.IO.File.Delete(myExportFile)
Catch
End Try