Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coloring matrix subtotal values (red for zero, green for bigger zero)

Status
Not open for further replies.

Handlerr

Programmer
Oct 27, 2008
10
DE
i have a simple matrix with a dynamic rowgroup, a dynamic columngroup and the subtotals for them.

all is ready and good, but now i have to colorize the values in the cells but only in subtotal row and colum. if the value is zero (0) then the font color must be red, if the value is bigger than zero (0) it must be green.
i tried this:

=
iif
(InScope("matrix1_ReVuShortCut"),
iif(InScope("matrix1_EventTyp"),
"Blue",
iif(Me.Value.ToString = "0", "Red", "Green")
),
iif(InScope("matrix1_EventTyp"),
iif(Me.Value.ToString = "0", "Red", "Green"),
iif(Me.Value.ToString = "0", "Red", "Green")
))

the reportmatrix shows the cell values outside the subtotals as expected in blue, but makes the zero (0) values in the subtotal column/row black and not red; the values that are not zero (0) in the subtotal column/row are green indeed! please see my screenshot...AND HELP ME IF POSSIBLE :)
thanks in advance....roland

matrixsubtotalcolor.png



=================================================
i tried my solution depending on this knowledge:
=
iif
(InScope("matrix1_ColumnGroup1"),
iif(InScope("matrix1_RowGroup1"),
"In Cell",
"In Subtotal of RowGroup1"),
iif(InScope("matrix1_RowGroup1"),
"In Subtotal of ColumnGroup1",
"In Subtotal of entire matrix"
))
 
forgot to write where i put the expression:
it is defined in the color property of the matrix detail textbox.
 
did solve it: do set the properties you wish (color, backcolor, text-decoration...) on the detailcell with the inscope function, e.g.:

=
iif
(InScope("matrix1_ReVuShortCut"),
iif(InScope("matrix1_EventTyp"),
"Blue",
iif(Me.Value.ToString = "0", "Red", "Green")
),
iif(InScope("matrix1_EventTyp"),
iif(Me.Value.ToString = "0", "Red", "Green"),
iif(Me.Value.ToString = "0", "Red", "Green")
))


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
and the most important thing is: you are not allowed to set anything on the properties of the subtotal(s); i know it is strange and i needed some hours to find out but i solved it by this way.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
Not so - you CAN set font properties on teh subtotal cell - to do so, you need to click on the little green triangle in the upper right corner of the cell and go to the properties from there - in that area, you should find that you don;t need to use InScope to set your colours

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
xlbo thanks for your answer.

i did try to set the properties in the properties window that opens after rightclicking on the green triangle already yesterday.

but if you want to set there cell-value-depending you will fail! you cannot use "Me.Value" in the expressions of the subtotalproperties...

perhaps i did do something wrong but did not manage it....
 
No you cannot use Me.Value but if the formula in the subtotal is something like =Sum(Fields!TheValue.Value) then you can use that in the expressions:

=iif(Sum(Fields!TheValue.Value)<=0,"Red","Green")

should work

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
unfortenately not in my case;
did try many combinations with sum(Fields!TheValue.Value)..................
did not success.

perhaps a issue of my database query i use for filling the matrix...but how said: MY problem ist solved, just wanted to post here my solution ;)

have a nice day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top