Solved

Expression to change field color in report writer

  • 30 March 2023
  • 7 replies
  • 145 views

Userlevel 5
Badge

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!

icon

Best answer by BenjaminCrisman 30 March 2023, 23:34

View original

7 replies

Userlevel 7
Badge +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?

Userlevel 5
Badge

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!

Userlevel 5
Badge

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?

 

Userlevel 5
Badge

 

Userlevel 7
Badge +4

@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

Userlevel 5
Badge

@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!

Badge

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

 

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved