Reputation: 17930
I have two tables in my database :
Order(OrderID, Date, ClientID)
OrderItem(OrderID, ProductID, Quantity)
1 Order can have multiple OrderItem(s). It's a one-to-many relationship.
I want to display these records in a master-detail fashion, as such :
Order 1 :
-OrderItem2
-OrderItem4
Order 2:
-OrderItem10
In my asp.net app, I have created a single DataSet that contains two DataTables (Order and OrderItem). the two datatables have a relationship based on the OrderID.
my questions are :
- Is this the right way to go in this situation ?
- Is there a more natural way to do this in Crystal Reports ?
Upvotes: 0
Views: 1804
Reputation: 7287
The natural way is to just group your report by Order (specifically, the OrderID). You can then place the OrderItem data in the Details Section of the report and Order data in the Group Header section of the report and it will display as you've described.
Upvotes: 1