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!

Is an Array the best thing?

Status
Not open for further replies.

morechocolate

Technical User
Apr 5, 2001
225
US
Version: Crystal 8.5

Say that I have the following in the details section (D)
Item No. Bank
D 1 BNY
D 1 CNY
D 2 CCA
D 5 KSD

Then I group on Bank and in the group footer I want the following

GF BNY/CNY 1
GF CCA 2
GF KSD 5

Would the best way to do this be by using an array?

Thanks
 
I think you could just use a formula for this, as in:

if {table.itemno} = 1 then "BNY/CNY" else {table.bank}

Insert a group on this. If you have too many different instances where you want to combine names to make this feasible, you could instead group on {table.itemno} and then create three formulas:

//{@reset} to be placed in the item no group header:
whileprintingrecords;
stringvar x := "";

//{@accum} to be placed in the details section:
whileprintingrecords;
stringvar x := x + {table.bank}+"/";

//{@display} to be placed in the item no group footer:
whileprintingrecords;
stringvar x;
left(x,len(x)-1)

-LB
 
Thanks for the reply LB, but it's not that simple. That was just a short sample. There would be 50 loan numbers which I would never know what those loan numbers are.

mc
 
Then, did you try the second suggestion?

-LB
 
Well, for this example, I knew that would not work either becuase the user wants the to group by description then by loan number.

What I decided to do was create a subquery using a SQL Expression selecting the minimum description for the loan number. I then, grouped on that value, then used the code you mentioned in the second suggestion. I've done the latter before.

I will just have to explain to the requestor what I did.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top