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

array 1

Status
Not open for further replies.

adhhealth

Programmer
Jul 1, 2004
165
US
crystal 8,pervasive sql 8.

Hi,

How do I get all the values of a database field called item numbers of the "detail section" into an array ?
 
Rather than stating that you want an array you might describe requirements rather than trying to force the use of arrays as they tend to slow things and there might be a different approach that you'd prefer.

Since they are item numbers, I'll assume that they are a numeric data type, and keep in mind that Crystal has a 254 character output limit for formulas, so if you exceed that it will error.

numbervar array itemnumbers;
numbervar qty:=qty+1;
redim preserve itemnumbers[qty];
itemnumbers[qty] := {table.field}

Now you can display them later referencing them as in:

numbervar array itemnumbers[1]

To get them individually

Another approach would be to convert them to strings and use the join/split functions as required.

-k
 
crystal 8 pervasive sql 8
My actual requirement:

(Bill of material)
Group header -Master Item number
Detail section - Raw material Item numbers.

I have to display only those items in which
in the detail section the raw material is entered twice(duplicate entry)
example

Master Item- ABC
RM1- r1
RM2- r2
RM3- r3
RM4- r2

(Observe here RM2=RM4)

I have to display only these master items.(for many of them raw materials are entered only once). I display only group header here..

( I was thinking i will read all the raw materials into an array and compare)
Pl. suggest if there is a better way.
THanks for the advise



 
Still a bit tough to accurately advise you since I'm not sure if the r2 is a seperate field.

Anyway, you might parse it into a formula if it's part of an existing field and check for the qty of the r2 entity.

In the Report->Edit Selection Formula->Group place something like:

count({table.rEntity},{table.groupfield}) > 1

In any case, an array is overkill, you can use functions to filter out the unwanted rows.

-k
 
Thanks for the reply,

detail section has a field called RM.
and the o/p could be the following:
RM1- r1
RM2- r2
RM3- r3
RM4- r2
count=4.

if i use
count({MIBOMD.RM},{MIBOMH.MASTERITEM})

it would return 4 !! and according to your formula >1
will then return all the records..

so, the requirement would be to return 2 which >1 would then be a success..how can we filter this

 
i mean..
in a case where
RM1- r1
RM2- r2
RM3- r3
count =3 (here the RM is not repeated) but still would be displayed if the above given formula is used..
so do you think i need to group by RM too ??
 
k,
Thanks for leading me in the right direction..
it worked..
what i did was ,i grouped by RM then put a count(summary in the group footer of this group..
then in group selection formula i used a similar formula suggested by you..
THanks again!!
I think you are an asset to this site!!star for you..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top