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!

How do you enable a report to change its MS SQL server and database? 1

Status
Not open for further replies.

PManion

Programmer
Feb 11, 2002
13
US
Our company's application has 18 Crystal Reports which access a SQL Server database using the OLE DB driver. However, one of these reports is not working correctly when the program is installed at the user's site.

Normally when these reports are created, CR stores the reference to the local server and database in the report. Of course, once the application is deployed at the user's site, the report should access the new server and database. One of our reports consistently fails to be able to do this. My supervisor says that his previous developer found a way to enable the 17 reports to be easily "relocatable", you might call it. But how this was done has been lost. My supervisor says he believes it was done by causing the report not to store the server and database names.

Our application is using the RDC ActiveX components in Delphi. Before opening the report, the application makes a call to SetLogOnInfo for each table in the report to be updated to the local server and database. Our 17 reports work correctly this way, but I have discovered by experiment that a report created from scratch does not work; it does not seem to respond to being "relocated" in this way. I also tried modifying one of the working reports by adding a new table to it, adding new fields, removing the old fields, and finally the old table. This also failed to be relocatable.

Is there some "treatment" that needs to be applied to a report that allows it to change at runtime from one database to another? Is this something that can be done programmatically at runtime, or is it done statically at report creation time? Any help with this question would be greatly appreciated.

Patrick Manion





 
Pat,

I was recently told by a fellow programmer that with SQL Server - you can remove the server and database names from the report itself to make it able to be run against different SQL Server databases.

To do this, open up the report in Crystal, and go to the database menu to Set Location - and for each table - remove the server/database name portion of the text from the bottom textbox. Easy as that.

Hope this helps

paulmarr@arcom.com.au
 
Paul,

Thanks so much. This appears to be the solution I was looking for. I might have searched forever and not stumbled upon it.

Jdemmi, what is this utility you are referring to?

Patrick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top