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!

Still learning! Read 24 fields in row, bold largest number. 2

Status
Not open for further replies.

buddygirl

Programmer
May 27, 2004
2
US
Hi,
I am running 8.5 . I have this report that displays 24 fields in one row. I need to bold the largest field. So I need to read each field and then compare them, then bold the largest field.
Example of 8 fields. 961 needs to be BOLD. How would I do this.

1 2 3 4 5 6 7 8
----------------------------------------------------------
234 956 376 102 32 956 961 523

Any suggestions?
 
What if more than one maximum values are the same?

Anyway, use a conditional formatting formula.

To simplify maintenance, try storing the fields to an array, as in:

whileprintingrecords;
numbervar array MyNumbers := [{table.field1},{table.field2},{table.field3}...etc.];

Then right click each field and select format field->Font->Style and use something like:

if {table.field1} = maximum(MyNumbers) then
crbold
else
crregular

Do so for each field.

This will BOLD any of the values that are the greatest for the list.

-k
 
I should have fleshed out that formatting formula more:

whileprintingrecords;
numbervar array MyNumbers;
if {table.field1} = maximum(MyNumbers) then
crbold
else
crregular

You need to reference the array first.

-k
 
Thank you for your help synapsevampire.

The array worked great!

Although, I had to make a change in the calling of the array. I couldn't get it to work the way you suggested.

Instead of placing the IF statement in the font/style x-2; I ended up making a copy of each field making one bold and the other regular font; then in common/suppress x-2 I placed the code you provided (whileprintingrecords;
numbervar array MyNumbers;if {table.field1} = maximum(MyNumbers) then true; with a minor change)
in the bold field and placed the opposite of your code in the regular field.

Its working!
Thanks for saving me hours of work by pointing me in the right direction.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top