The following is some code provided to me from Crystal
Reports that may help:
Sub SetReportFileLo cations(ByRef rpt As ReportDocument)
Dim crConnectionInf o As New ConnectionInfo
With crConnectionInf o
'physical server name (OLE DB) or ODBC DSN
.ServerName = DNSName
' Note: you do not need to set .DatabaseName for
Oracle.
.DatabaseName = DatabaseName
.UserID = LogonUserName
.Password = LogonUserPasswo rd
End With
'Get the table information from the report
Dim crDatabase As Database
crDatabase = rpt.Database
Dim crTables As Tables
crTables = crDatabase.Tabl es
Dim crtable As Table
'Loop through all tables in the report and apply the
connection
'information for each table.
Dim crTableLogOnInf o As TableLogOnInfo
For Each crtable In crTables
crTableLogOnInf o = crtable.LogOnIn fo
crTableLogOnInf o.ConnectionInf o = crConnectionInf o
crtable.ApplyLo gOnInfo(crTable LogOnInfo)
If crtable.TestCon nectivity() Then
' Create fully qualified name by
appending "database.owner ." to the table name.
crtable.Locatio n = DatabaseName & ".dbo." +
crtable.Locatio n.Substring(crt able.Location.L astIndexOf
(".") + 1)
Else
MessageBox.Show ("Connection Failed attempting to
connect to table: " & DatabaseName & ".dbo." +
crtable.Locatio n.Substring(crt able.Location.L astIndexOf
(".") + 1))
End If
Next
End Sub
-Lee
-----Original Message-----
I have a bunch of reports in crystal reports.net, i need
to basicly run themon differnt databases depending on which one the user
logged into at thevb.net application start (dev, live, testing)... now the
reports are createdat the development level.. so i figured just change the
database like youpass parameters to the report viewer... well.. I cant
seem to figure thatone out, but the report alone as an object
(ReportDocument object) has amethod SetDataSource which lets you specify the
user,pass,datab ase,servername per report... now my questions are
1) instead of at the report level can i do this at the
report viewer levelsomehow?
2) how do i use windows authentication with this? it
seems to supportuser/pass only.. thanks
.