Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping? Subreport? Which one is preferable?

Status
Not open for further replies.

humanageek

Programmer
Aug 2, 2005
6
US
Everyone,

I'm using CR9 and accessing an Oracle 9i database.

I've been asked to provide information about certain records which can be "parent" records to other "children."

If there is a parent-child relationship, in addition to showing the parent information, I'm required to display the multiple child records as well.

All information resides in the same tables, and it sounded like it might be really easy to do. I've been able to determine the existance of a relationship, but I don't know how to display the children's information.

I thought perhaps grouping, but I've tried and come up short. Any help anyone can give would be sincerely appreciated. Thanks!

Kyle
 
When you link two or more records in Crystal, this makes a 'row' which will appear in the detail section. Details can also be grouped.

For your case, group the 'children' by 'parent'. Each row within the group will have the same 'parent' and a different 'child'.

You could suppress these details and show counts or totals in the group footer.

Note that this depends on there being at least one 'child'. If not, do a left-outer link, which will allow groups with just the 'parent'.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Assuming you only want do display parent records (which may or may not have child records) and child records - no grandchild or deeper, this is fairly easy to do.

You'll actually need to have two "copies" of the table in your report. When you try to add an additional copy of a table to a report, Crystal will ask you for an "alias" for it. You'll use the aliased version of the table when displaying child records. For this example, I will call them Parent Table and Child Table.

Link from the Parent Table to the Child Table. Make this a Left Outer Join (right-click on the link and select Options.) This way, you'll also be sure to get the records that have no children.

Group on some identifier in the parent record - however you want your parent data sorted. Put the parent record data in the group header and/or footer sections. Put your child record data in the details section.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Just an opinion, and just from one voice, but ANYTHING is preferable to a subreport. Sometimes a subreport is the only way however.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top