Link to home
Start Free TrialLog in
Avatar of RUA Volunteer2?
RUA Volunteer2?Flag for United States of America

asked on

Suppressing records in a field based on a numeric value in Crystal Reports

I have a report with a single description field in it. At the moment I need a way of controlling what gets printed from the field in the details section. The contents of which are details from a Job Number. Each line of details has a Sequence Number or a Detail_ID field which I think I can use to suppress those lines not needed.

One problem is I need to suppress all blank sections. I know this is under the Section Expert. The fields that I think can be used are Sequence & Detail _ID both are numbers. A "0" in the sequence field is an empty value as is the lowest number in Detail_ID can be an empty value but not always. Sometimes there are no empty values.
There is a group on Job Number and I think by using the Sequence or Detail_ID field I can create a formula that will suppress rows conditionally?
If the Sequence field is used they print in the details section of Crystal like this:
Detail        0                                                         0     suppress all zero value line    
Detail        1                                                         1   .... this would be the one to display if only 2 in a sequence
Detail        2  .... this would be the one to display if the 3 are in sequence
(Sometimes the order of values are ( 0, 2, 1 ),  ( 1, 0 ) or even just ( 1 ) from top to bottom stacked in the details section.)

or Detail_ID  field    ........with the Detail_ID it should be the largest number.

15401    ......... Suppress
15402    ......... Suppress
15403    ........Display this line. The display value should be the largest number in the series?

I thought about using Max ({Detail_ID}, {JobNumber}) maybe in combination with NEXT ({fld})  but cannot seem to identify what should work?
User generated image
So in summary, I need the suppression of all blanks sections {sequence} = 0 or lowest numbers leaving the highest record in field to print the line.
Does anyone know of a good way to do this.?
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RUA Volunteer2?

ASKER

Amazing. That was it. I forgot about how Crystal Will print the one largest or smallest number in a group (based on ASC or DESC) if you drop a normally detail field in a group level. Such a simple thing. That was great. Thank you sir.
The best on the board in my book.