Randy Minder
Randy Minder

Reputation: 48522

Can I change the database server and database a report is pointing to dynamically?

I have a Crystal 2008 report that will be deployed to an InfoView server. There are four different databases the user might want to execute the report against. Each of the four databases have exactly the same schema. Only the data in each is different. Each database corresponds to a plant we have around the world.

Instead of creating four different reports (each one connected to one of the four databases), am I able to dynamically change the server/database the report hits based on a value the user enters into a parameter? I'm really trying to avoid having to create four identical reports except for the database connection on each. If this isn't possible, how do developers typically deal with this sort of scenario? I would imagine it's fairly common.

Thanks very much.

Upvotes: 0

Views: 1466

Answers (2)

craig
craig

Reputation: 26272

InfoView doesn't support dynamically changing a report's datasource. You certainly could modify InfoView source to suit your needs with the BusinessObjects Enterprise SDK, but that will be a challenge and won't be supported by BO.

Another option is to build a custom portal with the BusinessObjects Enterprise SDK, but this will require quite a bit of coding as well.

Probably the best option is to publish the report multiple times, set each datasource as appropriate (via the CMC), and change the name of the report to give an indication of its datasource (via the CMC). I there is a report property in the CMC that will save the datasource settings so you can quickly republish the reports if you make a change to the original.

Upvotes: 1

SqlACID
SqlACID

Reputation: 4014

I'm not familiar with InfoView, but it is quite common to do what you describe, I've done similar things with Asp.Net and Winforms; if you have access to the Crystal Reports object model, there are extensive options for setting logon info, I think it is SetDatabaseLogon; if you have subreports, you have to set the login for each of those separately.

The schemas do have to be completely identical, or the user will get warnings.

Upvotes: 0

Related Questions