Skip to main content
Answer

Highlighting every other line in Report Writer

  • November 14, 2023
  • 4 replies
  • 83 views

Forum|alt.badge.img

Group,

I started this on a tread that was marked completed, so afraid that it won’t be seen.  That original post had some great information, but I need a bit more. 

The report that I am working on is GL633500 from out of the box (I believe).

I duplicated a section to create a new highlighted area, but it didn’t move it directly under the original section.  How can I move it so that the new one is right below the original section? 

The red line row is the original section, the blue is the duplicate section.

 

The visible expression I attempted to use to highlight every other section, but it didn’t work.  So that is one area I could use some help with. Is there something we need to add to the filters in order to use like LineNbr in that expression?

Below is a screenshot of the report.  This is why I choose PeriodID.

This is what the report looks like when it is run:

 

Second question I have is with the visible expression on the original section.  There is already an expression listed there.  What would the best way to write it? (I am still very new to writing code).

 

Thank you in advance for any and all pointers!

Best answer by miguel80

Hi!

What I have done is:

  1. Create a second details section.
  2. Color the second one grey (for example) and the first one leave it as it is.
  3. Create a variable called “Background” on the detail section that changes form 0 to 1 when the variable is “0” and from 1 to 0 when the variable is “1”.  IIF($Background=1,0,1)
  4. Create a visibility condition where the first detail section is visible when $Background=0 and the second one when $Background=1

Does this make sense to you?

Also, for the visibility question try adding “AND $Background= 1” (or 0).

If you don’t know how to create variables then go to the details section and select the “Variables property”:

Create a new variable called “Background” with the following ValueExpr  =Assign('$Background',IIF($Background=1,0,1))

 I hope this works for you

4 replies

miguel80
Semi-Pro III
Forum|alt.badge.img+3
  • Semi-Pro III
  • Answer
  • November 15, 2023

Hi!

What I have done is:

  1. Create a second details section.
  2. Color the second one grey (for example) and the first one leave it as it is.
  3. Create a variable called “Background” on the detail section that changes form 0 to 1 when the variable is “0” and from 1 to 0 when the variable is “1”.  IIF($Background=1,0,1)
  4. Create a visibility condition where the first detail section is visible when $Background=0 and the second one when $Background=1

Does this make sense to you?

Also, for the visibility question try adding “AND $Background= 1” (or 0).

If you don’t know how to create variables then go to the details section and select the “Variables property”:

Create a new variable called “Background” with the following ValueExpr  =Assign('$Background',IIF($Background=1,0,1))

 I hope this works for you


aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • November 15, 2023

instead of creating two detail section you can simply check odd/even LineCounter and set the desired color on them


Forum|alt.badge.img
  • Author
  • Freshman I
  • November 15, 2023

@aaghaei ,

Where is the LineCounter located?  I have not seen that in Report Writer.

Thank you!


Forum|alt.badge.img
  • Author
  • Freshman I
  • November 15, 2023

@miguel80 ,

Your directions did assist in completing the task I was wanting.  

Thank you for your help!