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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display summary data seriatum ?

Status
Not open for further replies.

mocgp

Technical User
Jul 7, 2006
123
US
using BOXIR2; Oracle 9

A parts list report is grouped by part number and each detail row's unique value is a Site Code where the part is stocked. Each group will have anywhere from 1 to 10 different site codes. What I need in terms of layout is to place the part number information in the group header (or footer) and then display the site codes seriatum. For example:

The detail rows are...

Part # Site Code
12345 1
12345 2
12345 3
56789 6
56789 7

My target layout is...

Part # Site Code
12345 1, 2, 3
56789 6, 7

Thanks for any suggestions. (In case it makes any difference, the Site Code is a string field, not a number)


 
You can collect details from a group and show them all in the group footer. Try adapting something I wrote to collect postcodes:
Code:
// Accumulate using a formula field (suppressed) in the detail line.  Allow for nulls and blanks.
whileprintingrecords;
if not isnull({Recc.Postcode}) and {Recc.Postcode} <> " "
then stringvar pst := pst + {Recc.Postcode} +", "
else if length(pst) = 0 
then stringvar pst := pst + "Excluding blanks; "
else stringvar pst := pst
Code:
// Show in using a formula field in the group footer.
whileprintingrecords;
stringvar pst;
left(pst,len(pst)-2)
Code:
//  Clear using a formula field in the group header.
whileprintingrecords;
stringvar pst := "";
Note that clearing in the footer avoids problems with group headers repeating on a new page, which does clear everything for the group. Provided the 'clear' is placed in the section AFTER the display, it will do them in that order.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Or you could simplify that a bit and use:

//{@reset} to be placed in the part# group header:
whileprintingrecords;
stringvar code;
if not inrepeatedgroupheader then
code := "";

//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar code := code + {table.sitecode} + ", ";

//{@display} to be placed in the part# group footer:
whileprintingrecords;
stringvar code;
if len(code) > 2 then
left(code, len(code)-2)

-LB
 

Thanks, guys. I understand the logic now. It's just a manual running total with a string concatenation. The @display formula (lbass) worked; the one from Madawc (middle "code") errored out.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top