cancel
Showing results for 
Search instead for 
Did you mean: 

Switch database in Crystal Report 2013

Former Member
0 Kudos

Hi All,

I have Crystal Report 2013 and my client require to connect multiple database with single report. I have more than 10 MySql database and all database structure are same.

E.g. Create one report Employee Detail and connect using ODBC (RDO) I have successfully connected my single MySql database. Now I need to use this report for another database.

My question is how to switch database at runtime?


Anybody help me please.


Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

JWiseman
Active Contributor
0 Kudos

hi Bhavin,

you also may wish to look into mysql's Federated Tables, a similar feature to ms sql linked servers where the other db tables would show up as a view in your main db.

you should be able to use a stored proc that change the federated table on the fly based on a report parameter.

also in theory you could base your report off of a Command object that changed the federated table on the fly. a command object can work to change the tables on the fly if the tables are of the same structure and if the command outputs the same field names.

-jamie

abhilash_kumar
Active Contributor
0 Kudos

Hi Bhavin,

If you don't want to use the Set data source location feature, just configure the existing ODBC connection so that it points to the other database.

-Abhilash

Former Member
0 Kudos

Thanks for your quick reply.

If I am doing connection using ODBC that means we have to set database configuration before developing report. Means ODBC connect with single database and if we need to connect another database we need to change ODBC configuration manually but, I don't want to use this type of manual work.

Is there any way to change database dynamically?

Thanks.

abhilash_kumar
Active Contributor
0 Kudos

Hi Bhavin,

Ideally reports travel through different environments (Dev, QA, UAT, PROD) and hence we rarely need to switch the database manually as the ODBC in each if these environments takes care of this.

If you have a CR Server or BO server in your landscape, you could use Business View Manager to create a Business View that is based off of a Dynamic Data Connection. This DDC is in turn based off of multiple Data Connections that point to each of your Dev, Qa and Prod instances.

The report will need to be created against this Business View. When you run the report you'll be prompted to choose the database that the report should be run against.

If this something that you're trying to achieve, pls search for the Business View Manager Guide for more info.

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

Is there any other way to doing this without CR and BO server?

Thanks.

abhilash_kumar
Active Contributor
0 Kudos

I'm not aware of any other ways.

I'm assuming this could be possible using CR SDKs. You might want to ask in the CR .Net space.

-Abhilash

Former Member
0 Kudos

But we don't have .NET. Our client purchased Crystal Report Server 2013 OEM edition so how to do this thing with this product?

Thanks.

abhilash_kumar
Active Contributor
0 Kudos

I just gave you an option of using the Business View Manager with CR Server.

If you don't want to use that or a .Net app then I can't think of any other way to achieve this.

-Abhilash

Former Member
0 Kudos

Thanks a lot. I will check it.

ido_millet
Active Contributor
0 Kudos

At least one of the 3rd-party Crystal Reports viewers listed at http://kenhamady.com/bookmarks.html allows the user to select a different ODBC DSN on the fly.  This can be done either through the GUI or via a command line argument.  The GUI can expose either all DSN's on that machine for the user's choice or a restricted choice of DSNs that are within the same "group" of DSNs as the original report DSN.

DellSC
Active Contributor
0 Kudos

You can create either a .NET or a Java app to schedule or view the report - it would connect in to the CMS and handle things from there.  It's not difficult to set the database connection in code.  Your best bet for additional help will be to look here:  http://scn.sap.com/community/bi-platform/microsoft-net-sdk or here:http://scn.sap.com/community/bi-platform/java-sdk.  There is sample code available in both places as well.

Also, while I know that the utility Ido is referring to  will work with Crystal reports, I'm not entirely sure it will work with reports that reside in CRS.  So, you'll need to review it closely to determine whether it will work for you.

-Dell

ido_millet
Active Contributor
0 Kudos

As Dell indicated above, the viewer I mentioned does not work with or through Crystal Reports Server.