Print Page | Close Window

Multiple SubItems

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17956
Printed Date: 28 Apr 2024 at 12:44pm


Topic: Multiple SubItems
Posted By: darknoobie
Subject: Multiple SubItems
Date Posted: 07 Nov 2012 at 6:27pm
Hello forum,
I have just started using Crystal Reports. I'm using visual Studio 2005. I have a dataset with 2 tables.

Datable1:
MainItemIndex
ItemNumber
Description
qty
price

datatable2:
MainItemIndex
SubItemIndex
Description
qty
price

Im trying to link each SubItem(datatable2) with the MainItem(datatable1) using the MainItemIndex field. I can link them but I get the following

Item:1 Description Main Item Qty:12 Price:$12
       Description Sub Item 1 Qty 4 Price $0.50

Thats fine if I only have 1 sub item for each main item.
But If I have two subitems I get.

Item:1 Description Main Item Qty:12 Price:$12
       Description Sub Item 1 Qty 4 Price $0.50

Item:1 Description Main Item Qty:12 Price:$12
       Description Sub Item 2 Qty 4 Price $0.50

I would rather have it like the following.

Item:1 Description Main Item Qty:12 Price:$12
       Description Sub Item 1 Qty 4 Price $0.50
       Description Sub Item 2 Qty 4 Price $0.50

Item 2 .........

I have tried and googled for hours. Any help would be appreciated . Thank you

Also forgot to mention if I dont have a sub Item it does not show a main item.



Replies:
Posted By: lockwelle
Date Posted: 10 Nov 2012 at 4:16am
have tried creating a in the report for table1, mainindex
then displaying the details of table2?
 
if the sql looks good and it is returning what you expect, I would think that it is just a report layout issue.
 
and i've been wrong before ;)


Posted By: hilfy
Date Posted: 12 Nov 2012 at 11:06am
I think that what lockwelle is saying is to try creating a group on table1.mainindex (or any other field that you would use to sort the data from table1.
 
Put the fields from table1 in the group header section and the fields from table2 in the details section to get what you're looking for.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window