Hi, I've got one problem.. I've made a couple of reports using visual basic .net 2003 and crystal reports. The reports get their data from stored procedures in a database called DB1 for example. I connect to the database using ODBC and so that the report doesn't ask me for login/password at runtime I use the following code:
Private Sub ConfigureCrystalReports()
reporte = New rptReport1
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo
myConnectionInfo.ServerName = "REPORTES"
myConnectionInfo.DatabaseName = "DB1"
myConnectionInfo.UserID = "sa"
myConnectionInfo.Password = "XXX"
Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)
Dim myTables As Tables = myReportDocument.Database.Tables
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
For Each myTable In myTables
Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo
myTableLogonInfo.ConnectionInfo = myConnectionInfo
myTableLogonInfo.ConnectionInfo.DatabaseName = myConnectionInfo.DatabaseName
Now I want the report to get the information from a second database that has the same tables, stored procedures, etc. called DB2, but changing the code to myConnectionInfo.DatabaseName = "DB2" doesn't work. Anyone have any ideas?
I had also faced this problem in only crystal report 9, while not in crystal reprot 8
but now I feel crystal report 9 service pack 5 free available,It may fix problem
but some year ago when crystal report 9 was newly interduced I could not fix
then I found one thing
if we have to change our report loaction in deisgn time..some time I made copies of report with differnt server name, and db but , structure were interesting same
please if you found its solution tell me..but now a days I m working in Crystal Report 8. so I did not try to search this problem