Ok, two ways of doing this. The first way uses an array in Crystal to determine whether the part information has already been printed and then suppresses sections when it has.
1. Initalize a Shared Variable to contain an array:
StringVar Array parts := [""];
Place this formula in the report header. Nothing will actually appear on the report, but the array will be initialized.
2. Create a formula that concatenates the parent_part and component_part:
{parent_part} + {component_part};
3. Create a third formula that will add the value from step 2 to the array:
WhilePrintingRecords;
StringVar Array parts;
if parts[1] = "" then parts[1] := {@Concatenated_Part}
else if not {@Concatenated_Part} in parts then
{
redim preserve parts[length(parts) + 1];
parts[UBound(parts)] := {@Concatenated_Part};
}
Put this formula in its own Group Footer section for the Component_Part group (nothing else should be in the section with it). Make the section as small as possible and make it the LAST group footer section for Component_part Once again, it shouldn't show anything - it will just add the value to the array.
4. In the Section Expert, set the suppress formula for all of the parent_part, component_part, and details sections. The suppress formula will look something like this:
StringVar Array parts;
{@Concatenated_Part} in parts
This will suppress the section if the parent/component combination has already been printed. The issue is that Arrays in Crystal have a 1,000 element limit.
The second method involve writing a command (SQL Select statement) or a Stored Procedure that will return all of the data for the report, excluding the parts that have already appeared in an earlier operation. I can think of several different ways to write this depending on how your data is set up. This way the database is doing all of the work and Crystal doesn't have to. If your SQL skills are pretty good and you know the database well, this is the route I would take because it will be faster and you won't ever have to worry about the limit on the array size.
-Dell