Alternate row shading in Webi/Deski

One of our Business Objects Blog readers recently asked a question about alternate row coloring in Web Intelligence.

“Hi. I have a question on alternating row colors in Webi. I went to the properties and set 2 for the frequency in the “Alternate Row/Column colors” and have the specified color. Do you know why it’s showing as one color and not alternating the colors with white in between? Is there any other settings I need to change.
I’d appreciate your opinions. Thanks, Sam.”

I’m not sure about everyone else, but I have found that selecting a colour from the drop down list doesn’t appear to work for me. Instead I determine the RGB codes and entered them in the Color row. The Frequency of the alternate row is set to 2. This produces the desired alternate row effect.

alternate row shading - webi properties

Before this feature was available, I implemented alternate row shading via the use of a variable and the alerter feature. I’ll describe it here, both for Web Intelligence and Desktop Intelligence.

Web Intelligence alternate row shading

Through the use of the Odd() and LineNumber() functions, we can create a statement that can be used by an alerter to create our alternate row shading.

The steps to create this are as follows:

In the Formula Editor, create a new statement as follows:

=Odd(LineNumber())

alternate row shading - odd linenumber function

(You may need to temporarily add a new column to your table to do this. We can delete this later.)

The Odd function requires that you pass in a numeric value. It will determine if that value is odd. If it is, it will return a 1. If it is not, it will return a 0.

The LineNumber function simply returns the line number for each row in a table.

Put the statement into a variable, e.g. v_AlternateRowShading_Calc using the Create Variable icon.

alternate row shading - create variable

Highlight the column/s you wish to apply alternate row shading and click the Alerter icon.

alternate row shading - alerter icon

Create a new alerter and give it a meaningful name, e.g. a_AlternateRowShading.

In the cell ‘Filtered object or cell’, use the button to find your newly created variable. Chose ‘Select an object or variable’ from the drop down list.

alternate row shading - alerter editor parameters

Click OK.

Ensure the operator is set to ‘Equal to’

In the Operand(s) cell, type 1.

Then click the ‘Format’ button to set the format of the cell. In this case I’ve changed the background color to pink and the font color to black.

alternate row shading - alerter display parameters

Click OK, and OK again. The table should now have alternate row shading.

You can now safely remove the column containing the v_AlternateRowShading variable.

alternate row shading - report output

Desktop Intelligence alternate row shading

A similar process to the Web Intelligence method.

Create a new variable using the Variable Editor.

In the Definition tab, give it a meaningful name such as v_LineNumberFormat.

alternate row shading - deski variable editor 2

In the Formula tab, enter =Odd(LineNumber())

alternate row shading - deski variable editor

Highlight the column/s you wish to apply alternate row shading and click the Alerter icon.

Create a new alerter and in the Definition tab, give it a meaningful name, e.g. a_AlternateRowShading.

alternate row shading - deski alerter boxIn the Conditions tab, select v_LineNumberFormat from the drop down list of variables to compare.

alternate row shading - deski alerter box 2

In the cell ‘Filtered object or cell’, use the button to find your newly created variable. Chose ‘Select an object or variable’ from the drop down list.

Ensure Operator1 is set to ‘=’

In the Value 1 cell, type 1.

Then click the ‘Result’ drop down button, and select Format. Set the format of the cell. In this case I’ve changed the background color to pink and the font color to black.

Click OK, Apply and OK again. The table should now have alternate row shading.

alternate row shading - deski report output

Sam – I hope this helps to answer your question. Thanks for submitting a question to the BOBJBLOG!

Advertisements
%d bloggers like this: