Quantcast
Viewing all articles
Browse latest Browse all 221

alternate row colors in a break

Some days ago I had the requirement to show alternate row colors in a break.

In fact that I was missing a SCN-Entry about this - there we go:

 

(I am using BO 4.0)

 

Requirement:

Image may be NSFW.
Clik here to view.
req.png

 

Solution:

 

1. I create a variable RunningSwitcher with following definition:

=RunningCount(LineNumber();([Project]))

 

This gives me a number starting at 1 for each line of one project:

Image may be NSFW.
Clik here to view.
running_switcher.png

 

2. next I created a variable ProjectSwitcher with following definition:

=If(LineNumber()=1;1;If([RunningSwitcher]<>1;Previous(Self);Previous(Self)+1)) 

 

This variable gives me the same number for each project starting by 1:

Image may be NSFW.
Clik here to view.
switcher_color.png

 

3. a variable which checks if the ProjectSwitcher is even or odd to get one number for each even row and another for each odd row:

=Mod([ProjectSwitcher];2) 

 

Image may be NSFW.
Clik here to view.
breakColor.png

 

4 & last step: I created a conditional formatting on the last variable which just set a gray background color if the row number is 0:

Image may be NSFW.
Clik here to view.
conditional.PNG

 

That's it!

 

As a result I got this:

Image may be NSFW.
Clik here to view.
result.PNG

 

Hope that helps,

Andreas


Viewing all articles
Browse latest Browse all 221

Trending Articles