How to set Datasource pointing to multiple Database at the time crystal report creation
-
I need to create a crystal report and have to set Datasource location pointing to Development, Testing and Production servers. The created crystal report will be placed in database table and fetched at the time of reposrt generation by passing the credentials(Development or production). Please help me in this, I need a crystal report generated with multiple datasource connection. In C# I have written code as shown below:
oReport.SetDatabaseLogon(gcUser, gcPassword, gcDB, gcDB);
oReport.DataSourceConnections[0].SetLogon(gcUser, gcPassword); -
I need to create a crystal report and have to set Datasource location pointing to Development, Testing and Production servers. The created crystal report will be placed in database table and fetched at the time of reposrt generation by passing the credentials(Development or production). Please help me in this, I need a crystal report generated with multiple datasource connection. In C# I have written code as shown below:
oReport.SetDatabaseLogon(gcUser, gcPassword, gcDB, gcDB);
oReport.DataSourceConnections[0].SetLogon(gcUser, gcPassword);I have no experience with Crystal Reports; but most applications will only accept a single datasource. A simple workaround is possible if you have MS Access installed; create a new Access database, and in that database, create a linked table. SQL Server can also do this trick. The basic idea is that one would build the report on the single datasource (Access or SQL) that fetches their data from linked tables (that be pointing to your other datasources).
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
I have no experience with Crystal Reports; but most applications will only accept a single datasource. A simple workaround is possible if you have MS Access installed; create a new Access database, and in that database, create a linked table. SQL Server can also do this trick. The basic idea is that one would build the report on the single datasource (Access or SQL) that fetches their data from linked tables (that be pointing to your other datasources).
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
I need to create a crystal report and have to set Datasource location pointing to Development, Testing and Production servers. The created crystal report will be placed in database table and fetched at the time of reposrt generation by passing the credentials(Development or production). Please help me in this, I need a crystal report generated with multiple datasource connection. In C# I have written code as shown below:
oReport.SetDatabaseLogon(gcUser, gcPassword, gcDB, gcDB);
oReport.DataSourceConnections[0].SetLogon(gcUser, gcPassword);Ajay_Chaitanya wrote:
I need a crystal report generated with multiple datasource connection.
Not based on what you said you don't. What you have is one datasource which needs to point to actual different sources based on the install. The most obvious and easiest way to do that would be if all of the datasources had the same name. Which realistically they should. If that isn't the case then you are going to need to provide a configuration that MUST be set when it is installed. However if reports already exist using the same database then the configuration would already exist so you would just need to find it. I would suspect, strongly, that the Crystal reports API already has a way to support this. Probably via something like a named source. But other than that .Net apps have many configuration options. So you could use one of those. If you are using that then you need to look at the process (which is not code) of installing the application on the target machine, to validate that it will get set correctly. If it was me I would also add a check that insures that 1. The datasource properties are set (configuration) 2. The datasource is accessible. That would be OUTSIDE of crystal and would use normal .Net access to the database. All it needs to do is a simple query (need not return anything.) That insures that access is set and that the app has correct permissions to access it.
-
I need to create a crystal report and have to set Datasource location pointing to Development, Testing and Production servers. The created crystal report will be placed in database table and fetched at the time of reposrt generation by passing the credentials(Development or production). Please help me in this, I need a crystal report generated with multiple datasource connection. In C# I have written code as shown below:
oReport.SetDatabaseLogon(gcUser, gcPassword, gcDB, gcDB);
oReport.DataSourceConnections[0].SetLogon(gcUser, gcPassword);Multiple databases are really outside the scope of what CR is meant to do. That said, your best bet is to build and hydrate an object outside of Crystal Reports and set that as the datasource for the report. There are a lot of answers on the net about how to do this, just search for something along the lines of "Bind Crystal Report to object".