I'm using a Crystal Report Viewer in my .Net app and i use the following code to relocate tables in my 'normal' RPT reports:
With crConnectioninfo
.ServerName = <<DSN Name>>
.DatabaseName = <<Database Name>>
.UserID = <<ODBC User ID>>
.Password = <<ODBC User Password>>
End With
crRpt.Load(<<Full path to Crystal Report>>)
crTables = crRpt.Database.Tables
Dim crTable As CrystalDecisions.CrystalReports.Engine.Table
For Each crTable In crTables
crTableLogoninfo = crTable.LogOnInfo
crTableLogoninfo.ConnectionInfo = crConnectioninfo
crTable.ApplyLogOnInfo(crTableLogoninfo)
Next
ReportViewerCR.ReportSource = crRpt
It all works perfectly when i use a 'Normal' Crystal report i.e. any RPT file
However, when i use a Read-Only Crystal Report, RPTR, the code fails at the line
crTable.ApplyLogOnInfo(crTableLogoninfo)
and i get the following error message:
"Illegal operation on Crystal Reports Read-Only (RPTR) report. Please check release notes to get more information"
Can anyone please help?
Many thanks,
Jan