PC Review


Reply
Thread Tools Rate Thread

Crystal Reports - Setting up a one-to-many relationship in a crystal report

 
 
Stu
Guest
Posts: n/a
 
      30th Jan 2005
Hi there,

I am trying to set up a Crystal Report with the following tables:

Customer Info:
-Name
-Address
-CustomerID

Orders:
-CustomerID
-Order value ($)

I have N customers and each customer has M Orders. I need to display
the Customer Info for each customer, followed by a graph for each
customer's order values. I have defined a schema for the tables and
connected them with Crystal Reports Database Expert.

In order to do this, I have set up a Group in Crystal Reports based on
the Customer Name. In the footer of each group, I add a table that
displays the order values of the customer's orders.

This works fine, except for the fact that in the details section of
each group, the Customer info is repeated once for each Customer
Order. Obviously, I just want the Customer Info displayed once.

Is there a way to define a relationship like this? When I use the
Database Expert, I don't see any way to indicate that this is a
one-to-many relationship.

I am using Crystal Reports 10.

Any suggestions?

Thanks,
Stu
(E-Mail Removed)
 
Reply With Quote
 
 
 
 
PJ
Guest
Posts: n/a
 
      30th Jan 2005
Stu,

Move all of your customer info to the group header or format each field with
the suppress if duplicate option checked.

PJ


"Stu" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
Hi there,

I am trying to set up a Crystal Report with the following tables:

Customer Info:
-Name
-Address
-CustomerID

Orders:
-CustomerID
-Order value ($)

I have N customers and each customer has M Orders. I need to display
the Customer Info for each customer, followed by a graph for each
customer's order values. I have defined a schema for the tables and
connected them with Crystal Reports Database Expert.

In order to do this, I have set up a Group in Crystal Reports based on
the Customer Name. In the footer of each group, I add a table that
displays the order values of the customer's orders.

This works fine, except for the fact that in the details section of
each group, the Customer info is repeated once for each Customer
Order. Obviously, I just want the Customer Info displayed once.

Is there a way to define a relationship like this? When I use the
Database Expert, I don't see any way to indicate that this is a
one-to-many relationship.

I am using Crystal Reports 10.

Any suggestions?

Thanks,
Stu
(E-Mail Removed)


 
Reply With Quote
 
Bob
Guest
Posts: n/a
 
      31st Jan 2005
Hi Stu,
You may like to define a view in the database that gives you the detail data
that you want. This will give better performance than sucking in the raw
table data.
ie.
Create a view with:
Select customer.name,order.id,order.value from customer inner join order on
customer.id=order.customer.id
This will give a recordset which you would group on Customer.name
You would only place order.id and order.value in the detail section.
Then place your graph in either the group header or footer as required.
HTH
Bob
"Stu" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi there,
>
> I am trying to set up a Crystal Report with the following tables:
>
> Customer Info:
> -Name
> -Address
> -CustomerID
>
> Orders:
> -CustomerID
> -Order value ($)
>
> I have N customers and each customer has M Orders. I need to display
> the Customer Info for each customer, followed by a graph for each
> customer's order values. I have defined a schema for the tables and
> connected them with Crystal Reports Database Expert.
>
> In order to do this, I have set up a Group in Crystal Reports based on
> the Customer Name. In the footer of each group, I add a table that
> displays the order values of the customer's orders.
>
> This works fine, except for the fact that in the details section of
> each group, the Customer info is repeated once for each Customer
> Order. Obviously, I just want the Customer Info displayed once.
>
> Is there a way to define a relationship like this? When I use the
> Database Expert, I don't see any way to indicate that this is a
> one-to-many relationship.
>
> I am using Crystal Reports 10.
>
> Any suggestions?
>
> Thanks,
> Stu
> (E-Mail Removed)



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Crystal Report to Network Print Mailbox While Bypassing Crystal Report Viewer. John Smith Microsoft VB .NET 0 17th Jan 2007 04:17 PM
Crystal Reports Does Not Display BLOB Field Correctly in IBlobField Control Using Crystal Reports for VS.NET 2003 Jeff Microsoft Dot NET 0 4th May 2006 09:21 PM
First time crystal report user - How do i create a crystal reports from asp.net web form? Learner Microsoft ASP .NET 1 11th Jan 2006 08:20 PM
Crystal Reports - Setting up a one-to-many relationship in a crystal report Stu Microsoft Dot NET 2 31st Jan 2005 07:27 AM
Change Crystal Report Zoom Level using percentages in Crystal Report Viewer (Dotnet) Alex Stevens Microsoft Dot NET Framework Forms 1 30th Jun 2004 12:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:44 AM.