Crystal Reports and DataSets

J

John Smith

Hello all:

I am not sure if this is the right place to post this but I could not
find a specific Crystal Reports forum in the Microsoft forums nor the
Business Objects website.

Anyways, I am trying to find the best way to get data from several
tables into a single report. We have a series of records in one table
that relate to various jobs that we are bidding. We have another table
that has records of the many contractors that we deal with. These two
tables are setup in a many-to-many relationship so that we have an
interim table that links the two called bidstocontractors that contains
an id for each record made up of a bidid and a contractor id.

So on some reports we need to pull data relating to a job, but also the
records of the other table as well when needed. I have a DataSet that
contains all the tables but I'm not sure how to get the data for both
tables to display (for instance when I have a parameter setup to select
a subset of data). I am not even sure it is even possible.

Thanks for any direction you can give me.

- John -
 
B

Boyd Ferris

You can set the report's datasource to a dataset, which is in the "More
Data Sources" section. To set the report to use a dataset, you either
select an XML file describing the dataset or a class representing the
data. You can use the IDE to create a typed dataset, providing you
both options: XML and a class. If you do not want to use a typed
dataset in your code, then just create one for the sole purpose of auto
generating the XSD file. Use the SetDataSource method of the Crystal
report object so set the source during runtime.
 
J

John Smith

Boyd said:
You can set the report's datasource to a dataset, which is in the "More
Data Sources" section. To set the report to use a dataset, you either
select an XML file describing the dataset or a class representing the
data. You can use the IDE to create a typed dataset, providing you
both options: XML and a class. If you do not want to use a typed
dataset in your code, then just create one for the sole purpose of auto
generating the XSD file. Use the SetDataSource method of the Crystal
report object so set the source during runtime.
I have done this and already have it working to the point of getting the
data from one of the tables that are in the DataSet, but I need data
from two tables. Does Crystal support table joins. I can see that it
allows you to view the SQL query that it gets the data from but can you
edit this?
 
B

Boyd Ferris

Crystal supports table joins and filters. Use Visual Linking Expert to
create joins on your tables and use "Edit Selection Formula" context
menu to apply a filter to the information. (You can edit the selection
criteria by right clicking an empty spot on the report and selecting
the Report menu option.)


Good luck,

Boyd
 

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