It depends if you want to highlight the field or the entire 'row'
Use format field or section to apply the fype of highlight you prefer then use the formula button to the right of the highlighting option to set the condition by which the formatting occurs.
In this case for example:
if {table.field} = maximum({table.field}) then crsilver else nocolor
applied to the background 'X2' formula tab, should do the trick
Thanks CR85user, that looks good, but the field I want to highlight is a summary field and when I enter your code using my summarised field, I get the error message this field cannot be summarised.
You could use a separate field, placed beside the summary field you want to highlight. Have it show a star for the highest and otherwise be blank. Less elegant, but it should work.
Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10
You could use a variable to show the maximum in the report footer, or you could create a command like the following:
select sum(Activity.`tim`) as sumtim, Activity.`act_comment`
from Activity
Group by Activity.`act_comment`
Use the punctuation and syntax appropriate to your datasource. Link this command on the group field (comment) to the Activity table. Then in the main report, you can use a formula like this in the formatting area for background color:
if {Activity.tim} = maximum({command.sumtim}) then
cryellow else crnocolor
My summery is of a field called 'tim' in a table called 'activity'and it is being displayed in GH2. I would like the highest summery in the group to be displayed in another color.
Go to database->database expert->your datasource->add command and enter the command there. You have to use the syntax/punctuation appropriate to your datasource, so if you are unsure, go to database->show SQL query and observe how the tables and fields are punctuated there, and then use that in creating the command:
select sum(Activity.`tim`) as sumtim, Activity.`act_comment`
from Activity
Group by Activity.`act_comment`
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.