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!

Switching DataSources at runtime

Status
Not open for further replies.

RyanoUK

Programmer
May 20, 2003
22
GB
Is there anyway that I can switch DSNs at runtime on CE8.5

I'm coding in ASP and have tried scheduling a generic report against multiple DSNs, but it keeps complining about the logon information. The information sent is valid.

Any help would be appreciated.
 
CE is not designed for dynamically switching datasource in runtime, in CR, you can use setlogoninfo to change it. Furthermore, CE can't be approached with ASP, you need to customize its own CSP page to access the reports.

Ted
 
I have most of the code running using ASP because as I understand it, CSP pages are not supported in CE9.

I have the RAS components for CE8.5 to help with most of the coding.

The only area missing is the DSN switch.

 
Hi,
Once a report is designed, it is 'bound' to the data source and that cannot be changed by code.
This is true of CE and CR as far as I know..

( BTW,IIRC, csp was just Crystal's name for asp - in 9 they switched to the real extension)

[profile]



 
I can do it in CR no problems. Just have an issue 'saving' the report in CE.

I have managed to expose all the properties I need to including the Tables, but once you change the DataSource and Database names, I schedule the report to generate an instance. It's at this point it fails.

It is possible to do. I have spoken to Crystal Decisions recently and they have stated it can be done...but I don't want to pay them to do it!

 
Hi,
The only way I can find to change the datasource of a published report is to open that report from the Enterprise Folder in CR Pro and use the 'set location' functions to modify it and then re-save it to the folder.

I know of no code that could do this dynamically.

If Crystal Support says it can be done, search their support site for white papers or Tech Notes describing how...

[profile]
 
Have sused it out.

Have got the RAS for CE8.5. You can expose the report and create an instance of the report and display it. Does the job.

Not exactly dynamic as such, but works. Now onto the dynamic picklists. Hopefully got this one in the bag.

Thanks for the help.


 
I think RAS for CE8.5 can do it in some ways. I have spoken with Crystal Tech support people, that's what they told me. and DSN should be changed programmtically.

CR, for sure, you can switch datasource in runtime.

Don't know how about CE9, can anyone share how it works in CE or CR9?

Ted
 
The Set Location at Schedule Time capability was delivered in Crystal Enterprise 9.
 
Managed to get this sorted out.

Need to call ModifyTableConnectionInfo and SetTableLocation methods on each table.

Doing this can save over the existing report and display it to the user.

Also incorporates the dynamic picklist. Was a pain to get it working, but sorted now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top