Can a report-column be used conditionally like a report-body?
I'm trying to implement a basic table report which displays a list of projects build with a scaffolding template. Based on the data value of the project risk, I want the text to be red/yellow/green based on High/Medium/Low. I see here: http://www.customware.net/repository/... you can do conditional display based on text filters, however this doesn't seem to work with report-columns. Is there a way to make this work? Here's what I've got:
{report-table}
{local-reporter:page:children}
{date-sort:data:dueDate}
{local-reporter}
{report-column:title=Project}{report-info:page:title|link=true}{report-column}
{report-column:title=Project Manager}{report-info:data:projectManager|link=true}{report-column}
{report-column:title=Current Phase}{report-info:data:currentPhase}{report-column}
{text-filter:data:riskEstimate=High}
{report-column:title=Current Risk}{color:red}{report-info:data:riskEstimate}{color}{report-column}
{text-filter:data:riskEstimate=Medium}
{report-column:title=Current Risk}{color:yellow}{report-info:data:riskEstimate}{color}{report-column}
{text-filter:data:riskEstimate=Low}
{report-column:title=Current Risk}{color:green}{report-info:data:riskEstimate}{color}{report-column}
{report-column:title=Due Date}{report-info:data:dueDate}{report-column}
{report-table}
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
-
Inappropriate?The answer is 'sort of'. The main challenge with table columns is that if you skip one in a single row, any following columns will get displayed out of order. So, the solution here is to simply output a blank cell if the value on the current row is empty, which is what happens if the the filter(s) you provide as in your example are true. So, having three columns called 'Current Risk' will not quite work as you are expecting here.
However, the main issue here are in your filters. Try this instead:
{text-filter:data:riskEstimate|include=High}
However, I'm going to guess that you're using a {list-data} macro with {list-option} contents, so you actually need this:
{text-filter:data:riskEstimate > reference:value|include=High}
I'm not sure what other options are available in your 'riskEstimate' field, but something like this might do what you're after:
{text-filter:data:riskEstimate > reference:value|include=High,Medium,Low}
{report-column:title=Current Risk}{report-info:data:riskEstimate}{report-column}
-
Inappropriate?Thanks David. I was really trying to find an easy way to distingiush between the 3 values and give the report column value a color based on the value. I tested out what you mentioned and see what you're saying regarding the macro outputing a blank value if the filter fails. Like you said however, it doesn't work how I was thinking so I would still end up with 3 columns, just some of the values would be blank. I'll have to rethink this solution, and maybe just use report-body to get what I'm after. Thanks for your quick response. Cheers.
-
Inappropriate?I thought you might be going somewhere like that. You could use a {report-block} inside the column. Eg:
{report-column:title=Current Risk}
{report-block}
{local-reporter:data:riskEstimate > reference:value}{local-reporter}
{text-filter:@self|include=High}
{report-body}{color:red}{report-info:@self}{color}{report-body}
{text-filter:@self|include=Medium}
{report-body}{color:orange}{report-info:@self}{color}{report-body}
{text-filter:@self|include=Low}
{report-body}{color:green}{report-info:@self}{color}{report-body}
{report-block}
{report-column}
1 person says
this answers the question
Loading Profile...



EMPLOYEE