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!

Changing data source efficiently 1

Status
Not open for further replies.

tfernand

Technical User
Mar 3, 2004
11
US
All,
When we develop in Crystal reports, we use a development database as a data source. When its time for cutover is there a fast way to change the data source to be the production database. Right now, the only thing I could think of is going into each report and changing the data source to point to the production database. We have around 150 odd reports and this could be a tedious task.

Any help would be appreciated.
Thanks
-- Tony
 
Dave*: Sounds like a very useful bit of code, perhaps you could post it as a FAQ, or compile it and start a side biz.

The Crystal utility is useful as well, I used to have a link to it but lost it a long time ago, thanks for pointing it out.

-k
 
Thanks, Kai.

I'd thought about compiling it, but a FAQ sounds like a better idea (too chicken to take responsibility for breaking someone else's reports - let 'em break their own!!!).

I wrote the code 6 months or so before finding out that utility from Crystal existed. It turned out that it had some shortcomings, so while their utility was/is useful, my goofy little app handled one or two things theirs didn't.

-dave
 
thanks for the answers, will this util for Crystal 9 or is it too specific for Crystal 8 ?
 
Good question, Tony.

The object models from 8.5 to 9.0 didn't change that much. I don't know what their utility is doing, but I'd try it on a couple of reports (that are backed up, of course) to see what happens. It might not even let you open them, but since it's not dealing with the design aspects of the report, it might work.

-dave
 
I have also done this using the RDC in a program, in VB, VB.NET and C++. They are all a bit different so posting a FAQ could get cumbersome. Also in 9.0 Crystal added the ConnectionProperties object which you are supposed to use instead of LogonInfo.

Anyway, if you are in a Windows network and dB environment (SQL Server) the best way is to create the report using Windows Integrateed Security instead of an explicit logon ID. That way anyone who is authorized in the dB can use the report and security is controlled externally where it is supposed to be. I suppose something similar may exist for other dB envrionments.
 
Tony,

Don't know why I didn't think of this before, but you really don't need to do any of this to the reports.

You can set all of this information at runtime, regardless of what information is stored in the reports. We had this problem in our main application (which is written in Delphi) after someone named a production database to something other than what we'd been using for years.

Our first solution was to go into all of the reports (as you're considering) and updating each report manually. That's when I came up with my VB6 solution (since I was the grunt in charge of updating the reports). It allowed me to update all of the reports at once.

Finally, we realized how goofy that was, and came to the realization that all of this could be done at runtime, regardless of what's in the reports.

I found this FAQ last night that details this for C# and VB.Net: faq149-4870. Could be what you need.

The only time this creates an issue is if a client wants to modify one of their reports themselves, they might get errors when they try to run the report (because the db name information stored in the report file doesn't match the name of the database on their server). And in those instances, they just need to know how to use Set Location in Crystal.

-dave
(sorry if that was a bit long-winded)
 
If you don't mind a third party utility, our new .rpt Inspector 2 Professional Suite now comes in two editions. One that supports CR5.x-CR8.5 and one that supports CR9.x. Everything else in the two editions is the same. Including support of a new "data source / database conversion and migration wizard" which allows you to select one or more reports and select multiple sources to a destination for set location, convert driver, verify database. And we support ODBC / OLE DB / Native DB2 / Native Informix / Native Oracle / Native SQL Server / Native Sybase.

Both editions are now available for a FREE 30-day trial download.

Software Forces, LLC

===> two editions released: ".rpt Inspector 2 Professional Suite (for CR5.x-CR8.5)" and ".rpt Inspector 2 Professional Suite (for CR9.x)"
=====> download your FREE 30-day trial today!

proud makers of ".rpt Inspector" brand for Crystal Reports,
"SPL (Smart Pick Lists)" for Crystal Enterprise, and "SmartObjects" for Seagate Info & Crystal Enterprise.

Coming soon ".rpt Inspector 3 Enterprise Suite" for Crystal Enterprise
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top