Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Database connections 1

Status
Not open for further replies.

TheEagleHasLanded

IS-IT--Management
Feb 28, 2008
21
CA
Hi, is there a way to pass a database connection from the main report to the subreports?

As our report modules are being moved from one environment to another (DEV, TEST, PROD), the database connection info changes. We can pass a parameter to handle this for the main report, but is there a way to pass the parameters to all the subreports, so they can connect to the correct database?

Thanks,
T

 
You can make reports portable across environments by removing the schema name. You do do not say which CR Version, database or connection method. But if CR9 or
above.

Database-> Set Datasource Location

Open up each table by licking on each +
Double click Overridden Qualified table name and enter the table name.

Repeat for each table. If you then close and then open the SQL you will see that the tables no longer have a schema name and should be portble across your environments.

Ian
 
Hi Ian,

I am using Crystal Reports XI R2 and am attaching to a SQL Server 2005 database via Ole DB SQL Provider.

When we send the RPT file to our reporting servers, it usually looks at the registry and pulls the DB connection information via ODBC.

So in one environment it may be "\\dbserver\db1" and on another it could be "\\dbserver2\db1" ... etc.

When I build the subreports, I would want to use the same DB connection as the main report.

Can this be done with Crystal?

Thanks,
Trieu
 
Never tried it with and OLE DB connection, only done this on Oracle with a Native Connection.

However, since OLE DB connections tend to be schema specific I would not think that it will work.

Ian
 
Thanks Ian. I will look into the native Oracle connection. We can't use it now because of the way the third party module works, but if it is the only way to work then it is something I will push to our product team.

Thanks for the info.

Trieu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top