Crystal Reports - Multiple datsets as the datasource

L

lee_mcknight

I am using Crystal Enterprise V9. I have a report that needs to have
multiple datasets as the datasource(s) on a single subreport (some
common lookup data I need to join to is stored in a seperate dataset).


The report is working fine with a single dataset as a datasource, but I
cannot seem to find any examples of multiple datasets as a datasource.
Is this possible?

ReportDocument.SetDatasource() seems to only take a single dataset, and
I cannot figure out how to add more at runtime.

Thanks,
Lee
 
O

Octavio Hernandez

Lee,

I don't think it's possible to report off two different datasets. In first
place, you design it against only one XSD schema, right? And then is the
fact that SetDataSource() takes only one parameter.

¿Can't you copy the needed tables from the 2nd dataset to the first?

Regards - Octavio
 
L

lee_mcknight

Octavio-
I guess that's where I was getting confused. I have multiple
typed-datasets in my project, and crystal was more than happy to let me
use multiple typed-datasets at design time, but a run-time when it came
time to actually give the report datasources for those multiple
datasets, I couldn't figure out how to do it.

I think what I'll end up doing is making one huge dataset that combines
the schemas of all my seperate datasets and use that "super" dataset as
the datasource for my report. I was hoping to avoid this, however,
because it is extra code, extra datasets, and causes me to have data in
memory twice while creating the report...

Thanks for your help,
Lee
 
O

Octavio Hernandez

Lee,
... and crystal was more than happy to let me use multiple typed-datasets
at design time...

Now I see what you mean! Indeed, Crystal happily allows you to join data
from different data sets...
I remember Crystal always allowed (since version 6 or even before, if memory
doesn't betray me) the so-called heterogeneous joins, so that you could be
able to make a report joining (in the local memory of the client, of
course!) data coming from an Oracle table and an SQL Server table.
Obviously, this is what is happening here.
The problem is, how can we specify the multiple data sources at runtime? I
guess this is not supported anyway.
One potential idea you might like to try is to insert two "dummy" subreports
into the main report, each one using a different data set... At runtime, use
SetDataSource() on each subreport . I don't think it will work.
I think what I'll end up doing is making one huge dataset that combines
the schemas of all my seperate datasets and use that "super" dataset as
the datasource for my report. I was hoping to avoid this, however,
because it is extra code, extra datasets, and causes me to have data in
memory twice while creating the report...

After all, maybe it's the best solution. If you were able to specify both
datasets as datasources to the report,
Crystal would end up LOADING BOTH DATASETS INTO HIS OWN MEMORY in order to
do the joins, etc.

Regards - Octavio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top