Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how i make crystal report take data from two datasource

Status
Not open for further replies.

vpn2012

Instructor
Jan 8, 2012
31
I want to create crystal report take data from two databases how i make this ?
example
database a
CustomerID Name
1 ahmed
2 adil
database b
CustomerID Name
3 eyhab
4 saiad
after i make crystal report result must be
CustomerID Name
1 ahmed
2 adil
3 eyhab
4 saiad
 
If you don't need to sort them together, you could just add one of them in a subreport, placed in the report footer.

If you need to sort them together, then can both databases be accessed by the same driver? If so, you might be able to use a command with a union all clause like this:

select CustomerID,Name
from table1
union all
select CustomerID,Name
from table2

This would in effect "merge" the corresponding fields.

Otherwise, I think you would have to somehow link the two in Access or something and then use Access as your datasource. I can't really help with this, but you might be able to do a search to learn more about this technique.

-LB
 
Assuming the data is related and the data types are the same (and it appears to be from the sample provided), it is possible to join tables from physically separate databases in the same way you join tables from the same database. Crystal will complain, and tell you it is not supported, but it does work. It is very inefficient but if all else fails it might be worth a look. Your DBA may also be able to assist via linked servers or similar.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top