Crystal Reports 8.5 - Cannot Programmatically Connect Until Manually Opened
Posted on 2007-07-23
Hi everyone! I have another Crystal Reports 8.5 question that has me scratching my head. =)
I am programatically changing the database source, login name and password for Crystal Reports 8.5 reports (.rpt files). My intent is to be able to simply copy the .rpt files to any system with Crystal Reports 8.5 and my software installed, and when my software is run it will run the reports on that system's database.
I've noticed that, if I create a set of .rpt files on a particular system and then copy those .rpt files to another system, when I run my code that programatically changes the database source and tries to open the .rpt file it says that it cannot connect to the database (even if both the original and the new system that the .rpt files now reside on were using the same database and connection information).
However, if I open any one of the .rpt files in the Crystal Reports program itself and give it the database username/password manually, *ALL* of the .rpt files (not just the one that was directly opened) will now open correctly when I programmatically change their connection information.
Is there some kind of hidden INI file or Registry setting that Crystal Reports creates that is causing this to suddenly work if I open a file and connect it to the database manually? If I cannot create said file/setting manually, that means that I'll have to have the end user open one of the reports manually before they can use them automatically through my program... and that's less than ideal. =)
Thanks for any help you can provide!