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

Display value based on a formula that counts the number of selection

Status
Not open for further replies.
Aug 27, 2003
428
US
Hi,

I posted the above question in the incorrect forum.

I am using CR 9.0.

I have a string field called ProductID in a table say Product. Table Product has another column called Description which has multiple values for each ProductID like below:

Product ProductID

High Grade 1
High Yield 2
US Agency. 3

I want to use a formula such that if more than ProductID is selected then the report footer should list all Products separated by comma in the report footer.

Can I use something like the below formula?

IF COUNT{?ProductID} > 1 THEN PRINT {@DisplayProduct} + ',' + {@DisplayProduct} + ',' {@DisplayProduct}

to give
High Grade, High Yield, US Agency

Thanks in advance for your help!
 
In the detail section use:

//{@accum}:
whileprintingrecords;
stringvar x;
if instr(x,{table.product}) = 0 then
x := x + {table.product} + ", ";

In the report footer, use this:
//{@display}:
whileprintingrecords;
stringvar x;
if ubound({?Parameter}) > 1 and
len(x) > 2 then
left(x,len(x)-2)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top