Can someone help? I have applications running flawlessly under VS2008, WIndows XP, Crystal Reports 10, Visual Basic. When I attempt to upgrade them to VS2012, Windows 7, Crystal Reports 13, Visual Basic. Everything works except converting the Crystal Report to PDF. I get a database login error. I am attaching the code in question.
'******************************************************
'Export to PDF *
'******************************************************
Dim crtableLogoninfos AsNew TableLogOnInfos
Dim crtableLogoninfo AsNew TableLogOnInfo
Dim crConnectionInfo AsNew ConnectionInfo
Dim CrTables As Tables
Dim CrTable As Table
Report.Load("\\umcintranet3\payroll\WorkforceCentral\ActingPayReport1.rpt")
With crConnectionInfo
.ServerName = "xxxxxxxxxxx"
.DatabaseName = "xxxxxxxxxx"
.UserID = "xxxxxx"
.Password = "xxxxx"
EndWith
CrTables = Report.Database.Tables
ForEach CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
CrystalReportViewer1.ReportSource.Refresh()
CrystalReportViewer1.ReportSource = Report
'****************
Try
Dim CrExportOptions As ExportOptions
Dim CrDiskFileDestinationOptions AsNew _
DiskFileDestinationOptions()
Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions
CrDiskFileDestinationOptions.DiskFileName = pdfFile
CrExportOptions = Report.ExportOptions
With CrExportOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
.DestinationOptions = CrDiskFileDestinationOptions
.FormatOptions = CrFormatTypeOptions
EndWith
Report.Export() '<<<<<<<<< THIS IS WHERE THE ERROR OCCURS!!!
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error")
EndTry
Thanks, Les.