How can I change the data source (database server, username, password) that a Crystal report uses at runtime, running within a crystal server?
I have a crystal server and have uploaded reports that have a set datasource (SQL Server 2005 hosted on SERVER A, userA, passwordA). I would like to schedule reports to run using a different datasource (SQL Server 2005 hosted on SERVER B, userB, passwordB) from the c# client I've written.
The c# client can schedule reports to run within the server using objects provided by the crystal webservices. I've been using the following 3 objects:
BIPlatform
InfoObject
CrystalReport
Documentation on these objects can be found HERE
You should try to get some info about the ConnectionInfo Class
Programmatically Change a Crystal Reports datasource location - in VB but you can use one of the online translation tools to convert from VB to C#:
http://www.developerfusion.com/tools/convert/vb-to-csharp/ http://www.carlosag.net/Tools/CodeTranslator/
http://converter.telerik.com/
1/30/2018 -Just wanted to add that you will need the CrystalDecisions.ReportAppServer.DataDefModel dll
I had the same problem, where i have a report that has MSAccess database connection and i needed to change that to SQLServer, it took 2 days to figure this out: