Skip to main content
Answer

Multiple Visual Expressions

  • March 16, 2025
  • 3 replies
  • 89 views

Forum|alt.badge.img

Has anyone been able to have multiple visible expressions at once? I cannot get mine to work.

 

I have two I want to combine on the details section of a report: 

     1) Color coding every other line: =[$LineNbr] % 2 = 0  or in the second detail section it would be =[$LineNbr] % 2 = 1

  1. I have a Note section. It should only show if there is a note. If not then do not show:  = ([LineNote.NoteText]<>Null And [LineNote.NoteText]<>'')

 

How can I combine the two to make it work where it will color code if there is a note line, else the line does not show at all.

 

 

 

Best answer by Ankita Tayana

Hi ​@JReppard,

Use =IIf([LineNote.NoteText] <> Null And [LineNote.NoteText] <> '', IIf([$LineNbr] % 2 = 0, 'Color1', 'Color2'), 'Hide') in the visibility or formatting expression.

Hope this helps.

3 replies

bwhite49
Captain II
Forum|alt.badge.img+10
  • Captain II
  • March 16, 2025

You can use IIF formulas in visibility, so you could try something like this with multiple IIF statements...

= IIF(([LineNote.NoteText]<>Null And [LineNote.NoteText]<>''), IIF([$LineNbr] % 2 = 0, TRUE, FALSE), FALSE)


DrewNisley
Pro I
Forum|alt.badge.img+3
  • Pro I
  • March 17, 2025

Unfortunately this will break your color coding though. Just because it isn’t visible, doesn’t mean it doesn’t calculate your LineNbr variable. You’ll have to attach some sort of logic to your LineNbr variable, like so:

= IIF(([LineNote.NoteText]<>Null And [LineNote.NoteText]<>''), $LineNbr +1, $LineNbr)

This way it will keep the variable the same if it is not printing that section, making sure your colors alternate properly.

Edit: Do this on top of what ​@bwhite49 said to do for the visible expression


Forum|alt.badge.img+5
  • Jr Varsity I
  • Answer
  • March 17, 2025

Hi ​@JReppard,

Use =IIf([LineNote.NoteText] <> Null And [LineNote.NoteText] <> '', IIf([$LineNbr] % 2 = 0, 'Color1', 'Color2'), 'Hide') in the visibility or formatting expression.

Hope this helps.