
Crystal Reports and asp- re: dynamically change servers and databases at run time
I am using
Crystal Reports 7 in my asp site. My reports are working fine
however....
After development, it is time to move the reports to the production server.
Currently, because of the reports, we have three different sites because of
the way crystal reports works (ie. a report is linked directly to a database
during design). When we release a new report, it has to be coppied to all
three sites, then opened with crystal and then point the database to the
correct database. However, if I can get the reports to receive a
connection(real time), to dynamically change the database, then we could
have one site, and reduce maintenance. According to samples and
documentation, this should be possible:
GIVEN:
userid = "userid"
password = "password"
set Session("options") = Session("oApp").options
Session("options").MatchLogonInfo = 1
Set ReportDatabase = Session("oRpt").Database
Set crdatabasetables = ReportDatabase.tables
' Set the Logon for the stored procedure in the main report
set crtable = crdatabasetables.Item(1)
crtable.SetLogonInfo "SqlServer", "MyDatabase", cstr(userid), cstr(password)
Set Session("oRpt") = Session("oApp").OpenReport(path & "Kevin.rpt", 1)
If effect, this should change the database the report points to. The problem
is, it isn't. It still goes to the existing database and retrieves the
information. My asp calls a stored procedure and passes it parameters. I
have lot's with subreports, but if I can get the database to change, the
rest is elementary.
I am using cr version 7 and ms sqlserver 7.
Is there something in the report that needs to be set?
Any ideas??
Kevin