Crystal Reports and asp- re: dynamically change servers and databases at run time 
Author Message
 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



Fri, 23 May 2003 03:00:00 GMT  
 Crystal Reports and asp- re: dynamically change servers and databases at run time
Hi:

Does this statement works for you?

crtable.SetLogonInfo "SqlServer", "MyDatabase", cstr(userid), cstr(password)

 It does not work for me in ASP.

Dennis

Quote:
> 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



Fri, 30 May 2003 06:54:27 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Crystal Reports ASP Application hangs when running long reports

2. Dynamically changing the Database from ASP Pages.

3. Attn Tim Rude or anybody re Combo Box Style change at run time

4. Crystal Reports - Indicating Changes Dynamically (from VB 5)

5. Dynamically Changing a Crystal Report from a VB Form

6. Running Crystal Report Web Component Server and SQL Server on different machines

7. Crystal Report Component for VB run on ASP

8. running Active Server on NT Server 4.0 for Crystal Reports

9. Crystal Reports from ASP.NET without compiling VB.NET on SQL/ADO changes

10. ASP+Crystal Reports 8.5 Changing data source problem

11. Crystal Reports v9 hangs in ASP page on Win2K and .NET Server

12. How to change Crystal Report 8 rpt dsn using RDC in asp page

 

 
Powered by phpBB® Forum Software