It is possible to control the display of your report by using simple conditional tags.
Conditionals require three parts:
- A condition that evaluates to true or false
- An action to take if the condition evaluates to true
- An optional action to take if the condition evaluates to false
Conditionals can make use of the comparison operators >, >=, =, <, <=
To use a tag in either action, use |EVALTAG()| instead of the typical {}.
To combine conditions, use || for OR and && for AND.
Examples:
#Display a '+' if a score is positive
{DATAPOINTS.SCORE>0?+}
#Control a cell's class based on score
<td class="{DATAPOINTS.SCORE>=90?good-score:bad-score}">
#Display a '-' if a score is NULL, otherwise display the score
{DATAPOINTS.SCORE=|EVALCONST(NULL)|?-:|EVALTAG(DATAPOINTS.SCORE)|}
#Only display a comma if the loop we're in has more items
{LOOP.HASNEXT?,}
#Control a cell's class based on the responses to two questions both being 'no'
<td class="{DATAPOINTS.CLIENT_1_SURVEY_1000_QUESTION_51_ID=2&&DATAPOINTS.CLIENT_1_SURVEY_1000_QUESTION_101_ID=2?bad-response}">
#Control a cell's class based on the responses to either of two questions being 'no'
<td class="{DATAPOINTS.CLIENT_1_SURVEY_1000_QUESTION_51_ID=2||DATAPOINTS.CLIENT_1_SURVEY_1000_QUESTION_101_ID=2?bad-response}">