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!

How make array from 2 fields in GF3 and display in GF2 as 1 field?

Status
Not open for further replies.

WaukMyWay

Programmer
Apr 20, 2007
29
US
I am using CR10 and a 3rd party database. I have not yet been successful at arrays. This is one instance where I believe I must use them.
I need to show the header and just Group Footer 2 in the report. The information I need to get into an array is in Group Footer 3. This is actually from the Top 2 scrapped quantities reason codes for a part. I need to display both of these records in one field along with their corresponding percentages. It would be such as this:

Part# $Prod. $Scrap. Reason Scrap% Desc.
A 46044 3257 5.43% Dirt/Sand
1.36% RUNOUT

Should show as:
A 46044 3257 5% DIRT/SAND, 1% RUNOUT

How does one go about taking 2 fields from Group Footer 3 and putting them into a an array to be displayed in one field in Group Footer 2?
 
Are you using a topN/group sort to get these two instances of the field?

-LB
 
Actually, both groups TopN sorts are based on Sum of @DollarsScrapped. The GF2 is Top 10 parts and the GF3 is Top 2 reason codes.
The user has preferred to not include ties on the reason codes at this time. This may be included at a later date.
 
Create three formulas:

//{@reset} to be placed in the GH2:
whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";

//{@accum} to be placed in GF3:
whileprintingrecords;
stringvar x;
x := x + totext({@percentcalc},0)+"% "+{table.desc}+", ";

//{@displ} to be placed in GF#2:
whileprintingrecords;
stringvar x;
if len(x)> 2 then
left(x,len(x)-2);

-LB
 
First of all, lbass, I thank you so very much for your never ending help!

From your instruction here, I would have to say I now have a basic understanding of how to work an array into just about any report.

Thanks again, LB!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top