Skip to main content
Answer

Need help formatting VisibleExpr for Report Designer

  • May 22, 2023
  • 6 replies
  • 232 views

Forum|alt.badge.img

Hi all,

I need a visible expression that if an item is active (“AC”) then the font is normal (black), if it’s active with a pop up note print it blue, and if it’s inactive (<>”AC”) print it red. I’m messing up my expr somewhere:

 

=[InventoryItem.ItemStatus] = "AC" and [InventoryItem.Note] is not null, "Blue", [InventoryItem.ItemStatus] <> "AC", "Red", "Black"

 

Best answer by lauraj46

Hi @swartzfeger ,

Try looking for an empty string:

=[InventoryItem.ItemStatus] = "AC" and [InventoryItem.NoteText] = ''

I tested this and it worked for me.

Hope this helps!

Laura

6 replies

lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • May 22, 2023

Hi @swartzfeger ,

The only way that I know of to accomplish conditional formatting is with overlapping controls.  Use the VisibleExpr field to make visible only the version of the control that has the desired formatting based on the criteria.

Hope this helps!

Laura


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • May 22, 2023

Hi @swartzfeger ,

The only way that I know of to accomplish conditional formatting is with overlapping controls.  Use the VisibleExpr field to make visible only the version of the control that has the desired formatting based on the criteria.

Hope this helps!

Laura

I’m trying that but also failing, lol -- this is what I have -- 3 different text boxes to each display black, blue or red:

 

=[InventoryItem.ItemStatus]=’AC’ AND [InventoryItem.NoteText]=0

=[InventoryItem.ItemStatus]=’AC’ AND [InventoryItem.NoteText]<>NULL

=[InventoryItem.ItemStatus]<>’AC’

It’s the first one that is causing problems… I can get the BLUE and RED to print, but the first expression is wrong.

 

=[InventoryItem.ItemStatus]=’AC’ AND [InventoryItem.NoteText]=0

 

I need to say “and inventory note is empty”, and =0 seems to make it error. Is “[InventoryItem.NoteText] Is Null” correct?


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • May 22, 2023

Hi @swartzfeger ,

For black the formula would be

=[InventoryItem.ItemStatus] = "AC" and [InventoryItem.Note] = null

It’s different form the SQL syntax :)

Laura

 


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • May 22, 2023

Hi @swartzfeger ,

For black the formula would be

=[InventoryItem.ItemStatus] = "AC" and [InventoryItem.Note] = null

It’s different form the SQL syntax :)

 

Thanks Laura, it’s appreciated. It seems to work but the BLUE expr

=[InventoryItem.ItemStatus]=’AC’ AND [InventoryItem.NoteText]<>NULL

seems to be overriding the BLACK expr

=[InventoryItem.ItemStatus]=’AC’ AND [InventoryItem.NoteText]=NULL

 

Maybe I need to point to something else and not .NoteText


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • Answer
  • May 22, 2023

Hi @swartzfeger ,

Try looking for an empty string:

=[InventoryItem.ItemStatus] = "AC" and [InventoryItem.NoteText] = ''

I tested this and it worked for me.

Hope this helps!

Laura


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • May 22, 2023

Hi @swartzfeger ,

Try looking for an empty string:

=[InventoryItem.ItemStatus] = "AC" and [InventoryItem.NoteText] = ''

I tested this and it worked for me.

Hope this helps!

Laura

Thanks Laura, that did the trick! I also had to change <>NULL to <>’’