You do not need a calculation to color a table cell by rating. Add the rating-based background option to the merge string, and the cell background takes the color of the rating that applies to that score.
Add the following parameter to the merge string in the table cell:
BackgroundColour=Rating
For example, to display the rating name in a table cell, with the whole cell shaded in that rating's color:
{RatingSection.RatingName[SectionNo=2 BackgroundColour=Rating]}
The same parameter works on a score, if you would rather show the number:
{RatingScore.Score[SectionNo=2 BackgroundColour=Rating]}
In the Merge Manager, the same parameter is added by choosing Options > Background Color, then selecting Rating in the Background Color field.
Points to check
- The merge string must be inside a table cell. The parameter colors the entire cell, so it has no effect on a score placed in an ordinary paragraph.
-
It works with both scores and rating names.
BackgroundColour=Ratingcan be added to the percentage score, the average points score, and the rating name. - The color comes from the rating band. It changes automatically when the score falls into a different band. To change which colors are used, edit the colors on the rating. See Where do I change the color of a rating band?
-
Use a rating type for a separate color scheme. If this table needs different colors from the rest of the report, add
RatingType=nto point the merge string at an advanced rating type with its own colors.
Coloring a whole table at once
If you want every cell in a results table colored by rating, rather than one cell at a time, add the same parameter to a {Tables[...]} merge string. This produces a heatmap:
{Tables[SectionNo=ALL SubSectionNo=ALL SplitType=R BackgroundColour=Rating]}
The only difference between a plain table and a heatmap is this parameter.
For full details, see Displaying Scores in Report, Tables and Heatmaps and Setting Rating Colors and Chart Styles.
Comments
0 comments
Please sign in to leave a comment.