• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1471
  • Last Modified:

Multiple Starting points

How can I have multiple datasource in CR 9.

For ex. If I have tables linked as one datasource and if I define a SQL as another datasource, Then I get an error saying "More than one datasource is used....".

But I would like to have columns from both the datasource. They are different fields from different tables under different conditions.

Any inputs appreciated
  • 2
1 Solution
Crystal recommends using subreports when multiple datasources are needed.


Kurt ReinhardtCommented:
There are definitely issues when you attempt to join tables from different databases - even if the type of database is the same (two SQL Server Databases on the same machine will still give you fits).  While you can do it, your options for joins and fields are extremely limited as you found out.

Subreports are definitely a viable option, but they might not be the most efficient.  The section in which the subreport is placed and the size and integrity of the tables used can definitely affect performace.  For example, if you place the subreport in the detail level of the master report and there are 5k detail lines in the report, then the subreport will be executed 5,000 times!  This can cause performance nightmares, both in Crystal and on the database.

Other options you have are:

1)  Link all of the tables in MS Access, then use Access as the sole datasource for the report
2)  Create a View in your database - the databases can be joined in the View, which will be used as the sole database for the report
3)  Create a Stored Procedure - the databases can be joined in the Procedure, which will be used as the sole database for the report
4)  Create a SQL Command Object with Crystal Reports 9 - the databases can be joined in the Command, which will be used as the sole database for the report

See some commonality between all of these solutions?  Different ways of accomplishing the same thing, but they can all be viable options.  The benefit to using any one of these solutions is that your performance is pretty much guaranteed to be better than if you use subreports.

Glad i could help


Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now