Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error : table could not be found. when run CR from .NET code

Status
Not open for further replies.

lifeforest

Programmer
Nov 9, 2006
16
CA
Further to my other question here, the code has error when run to myTable.Location code.

myTables = myReportDocument.Database.Tables
For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables
myTableLogonInfo = myTable.LogOnInfo
With myTableLogonInfo.ConnectionInfo
.ServerName = myConnectionInfo.ServerName
.DatabaseName = myConnectionInfo.DatabaseName
.UserID = myConnectionInfo.UserID
.IntegratedSecurity = myConnectionInfo.IntegratedSecurity
.Password = myConnectionInfo.Password
End With
myTable.ApplyLogOnInfo(myTableLogonInfo)


myTable.Location = myConnectionInfo.DatabaseName & "." & QualifiedName(1) & "." & myTable.Location.Substring(myTable.Location.LastIndexOf(".") + 1)

The thing is when i run from CR2008 everything looks fine.

Any ideas guys? Thanks for any help!!!
 
Figured out the solution:


QualifiedName= Split(myReportDocument.ReportClientDocument.Database.Tables(0).QualifiedName, ".")

myTable.Location = QualifiedName(0) & "." & QualifiedName(1) & "." & QualifiedName(2)

Somehow this doesnt work:
strLocation = myReportDocument.ReportClientDocument.Database.Tables(0).QualifiedName
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top