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

Need A Formula That Shows ALL the Data of One Field in a NEW Formula

Status
Not open for further replies.

RoMarcus

MIS
Oct 16, 2007
45
US
Need to make a formula based on something like this....

record state name
123 NC John
124 NC Bill
125 FL Mary
126 GA Bob
129 TX Susie
130 TX Dave
131 TX Mike


I am grouping records by month (field not showing - not relavent) - I want to be able to include in the group heading a field that will show the following results:


FL, GA, NC, TX ( in alpha order )



"All customers located in {@statelist} "

How do I do that?

Thank you.
 
You can collect fields and show them in the footer. Adapt this code that I wrote for postcodes:

// Accumulate using a formula field (suppressed) in the detail line. Allow for nulls and blanks.
Code:
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.

But this won't work for the header. If it has to be the header then you'd need to use a subreport, which will slow processing a great deal.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Thank you - I used a variation of that and it is working in the group header.

Appreciate the reply...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top