Skip to main content
Solved

Expression to change field color in report writer


Forum|alt.badge.img

Hi, we have a report with some colored fields in report writer, but if a customer is INACTIVE, we would like to highlight the field RED (first row would be the inactive customer):

the layout

Pretty sure I need an expression here in Report Designer, but not sure what the syntax would be -- my syntax is clearly wrong! :D

if [BAccount.Status] = INACTIVE, then MAKE RED isn’t correct:)

How do I correctly express this, and does it go into Properties>VisibleExpr?

Thank you so much!

Best answer by BenjaminCrisman

@swartzfeger Sorry, I am not sure why I thought ‘Inactive’ would work, I think it’s incorrect.

This is the database values for the different status:

So it would be =[BAccount.Status]= ‘I’

That should work better

View original
Did this topic help you find an answer to your question?

7 replies

BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4

Hi @swartzfeger! For this issue I would recommend to have 2 fields placed on top of each other. The first being the green and the second being the red.

You can use a visibility expression to control which field displays.

=[BAccount.Status]=’Inactive’ < for the red fields

=[BAccount.Status]<>’Inactive’ < for the green fields

Otherwise I think it would get messy with IIF statements and Switch() expressions.

Have you already tried something like this though?


Forum|alt.badge.img
  • Author
  • Freshman II
  • 129 replies
  • March 30, 2023
BenjaminCrisman wrote:

Hi @swartzfeger! For this issue I would recommend to have 2 fields placed on top of each other. The first being the green and the second being the red.

You can use a visibility expression to control which field displays.

=[BAccount.Status]=’Inactive’ < for the red fields

=[BAccount.Status]<>’Inactive’ < for the green fields

Otherwise I think it would get messy with IIF statements and Switch() expressions.

Have you already tried something like this though?

No I haven’t, our Report Designer guy left and I’m taking over, slowly ramping up -- but now that you mention it, I’ve gone through his work and this appears to be the method he used -- stacked fields. Field A uses expression A, Field B uses B. The big help is the Expression… thank you!


Forum|alt.badge.img
  • Author
  • Freshman II
  • 129 replies
  • March 30, 2023
BenjaminCrisman wrote:

Hi @swartzfeger! For this issue I would recommend to have 2 fields placed on top of each other. The first being the green and the second being the red.

You can use a visibility expression to control which field displays.

=[BAccount.Status]=’Inactive’ < for the red fields

=[BAccount.Status]<>’Inactive’ < for the green fields

Otherwise I think it would get messy with IIF statements and Switch() expressions.

Have you already tried something like this though?

I duplicated the field and have one set to = ‘Inactive’ and the other set to <>’Inactive’ but it’s still highlighting all customers/rows as though they’re active. Any ideas? The active/inactive fields are sitting on top of one another (the same location) so I’m not sure if the active is precluding the inactive from being displayed because it’s covered?

 


Forum|alt.badge.img
  • Author
  • Freshman II
  • 129 replies
  • March 30, 2023

 


BenjaminCrisman
Acumatica Employee
Forum|alt.badge.img+4
  • Acumatica Support Team
  • 630 replies
  • Answer
  • March 30, 2023

@swartzfeger Sorry, I am not sure why I thought ‘Inactive’ would work, I think it’s incorrect.

This is the database values for the different status:

So it would be =[BAccount.Status]= ‘I’

That should work better


Forum|alt.badge.img
  • Author
  • Freshman II
  • 129 replies
  • March 30, 2023
BenjaminCrisman wrote:

@swartzfeger Sorry, I am not sure why I thought ‘Inactive’ would work, I think it’s incorrect.

This is the database values for the different status:

So it would be =[BAccount.Status]= ‘I’

That should work better

Benjamin -- YOU RULE! That did it and it would’ve taken me forever to figure that out… thanks!


tahirsiddiqui190
Freshman I
Forum|alt.badge.img

hellow fellows i have any issue i dont  understand why its not working properly

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings