on 08-29-2014 8:41 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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.
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
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.