Dear all,
Now I am using the report document in vb.net to call the crystal report
and I will set the database information in the report document. The code is
as follow:
...
ReportTemp.Load(_reportname)
For Each table In ReportTemp.Database.Tables
logoninfo = table.LogOnInfo
With logoninfo.ConnectionInfo
.ServerName = "Server"
.DatabaseName = "DatabaseA"
.UserID = "abc"
.Password = "abc"
End With
table.ApplyLogOnInfo(logoninfo)
Next table
....
Now, the crystal report is based on the database "DatabaseA" to draw.
However, now, I have two database with the same structure like "DatabaseA"
and "DatabaseB".
While I want to call the data in "DatabaseB" with the crystal report, I
change the database name as follow in vb.net
...
ReportTemp.Load(_reportname)
For Each table In ReportTemp.Database.Tables
logoninfo = table.LogOnInfo
With logoninfo.ConnectionInfo
.ServerName = "Server"
.DatabaseName = "DatabaseB"
.UserID = "abc"
.Password = "abc"
End With
table.ApplyLogOnInfo(logoninfo)
Next table
....
However, finally, the report come out call the data in DatabaseA and not
DatabaseB.
Please help. Or should I create the report for different database even for
same report same structure?
Thanks a lot,
Ray