Tuesday, March 20, 2012

Background Colour of Matrix cells

Hi All
I have a matrix that goes no bigger than 4 colums and 4 rows big.
I need to have different colours for certain cells within the matrix.
e.g for the first row, i need:
Cell1 = Yellow
Cell2 = Blue
Cell3 = Green
Cell4 = Green
for the 2nd row i need:
Cell1 = Yellow
Cell2 = Blue
Cell3 = Green
Cell4 = Green
for the third row in need:
Cell1 = Red
Cell2 = Yellow
Cell3 = Blue
Cell4 = Blue
and finally for the forth row i need:
Cell1 = Red
Cell2 = Red
Cell3 = Yellow
Cell4 = Yellow
Does anybody know a way setting these to the desired colours?
please help!!!!!!
--
Thanks in advance,
Dave HuntDustpanDave,
According to the "Hitchhiker's Guide to SQL Reporting Services" book, page
433-436, you'll have to use RunningValue and CountDistinct within a Matrix.
They say:
1) Add a Row Gropu called RowColor and give it a grouping expression of "=1"
2) Find the textbox for RowColor and enter the expression
"=RunningValue(Fields!<columngroupname>.Value & Fields!<2ndColumnGroup>.Value
..., CountDistinct, Nothing)"
3) Then enter an expression into the background color for all of the fields
in question: "IIF(RunningValue(Fields!<ColumnGroupName>.Value &
Fields!<2ndColumnGroup>.Value & ..., CountDistinct, Nothing) mod 2, "Color1",
"Color1")
4) The ROWColor Textbox MUST remain visible (you can't hide it), but you can
shrink it's height, set the font to 1 pt, zero out your padding and/or set
the main Color property to the color of your background.
I hope this helps. I haven't done this in a Matrix yet. I've just used the
simpler format for table rows. The book is pretty decent and has helped me a
lot. I'd advise buying a copy, or at least buying a SQL RS book. Don't get
the one published by WROK, though. It's not the best of the available
material.
Catadmin
--
MCDBA, MCSA
Random Thoughts: If a person is Microsoft Certified, does that mean that
Microsoft pays the bills for the funny white jackets that tie in the back?
@.=)
"DustpanDave" wrote:
> Hi All
> I have a matrix that goes no bigger than 4 colums and 4 rows big.
> I need to have different colours for certain cells within the matrix.
> e.g for the first row, i need:
> Cell1 = Yellow
> Cell2 = Blue
> Cell3 = Green
> Cell4 = Green
> for the 2nd row i need:
> Cell1 = Yellow
> Cell2 = Blue
> Cell3 = Green
> Cell4 = Green
> for the third row in need:
> Cell1 = Red
> Cell2 = Yellow
> Cell3 = Blue
> Cell4 = Blue
> and finally for the forth row i need:
> Cell1 = Red
> Cell2 = Red
> Cell3 = Yellow
> Cell4 = Yellow
> Does anybody know a way setting these to the desired colours?
> please help!!!!!!
> --
> Thanks in advance,
> Dave Hunt|||Oh, I forgot to mention, this is to get alternating rows of color. You'll
have to play with it to get specific cell colors. Also, look up RowNumber()
function in BOL.
Catadmin
--
MCDBA, MCSA
Random Thoughts: If a person is Microsoft Certified, does that mean that
Microsoft pays the bills for the funny white jackets that tie in the back?
@.=)
"DustpanDave" wrote:
> Hi All
> I have a matrix that goes no bigger than 4 colums and 4 rows big.
> I need to have different colours for certain cells within the matrix.
> e.g for the first row, i need:
> Cell1 = Yellow
> Cell2 = Blue
> Cell3 = Green
> Cell4 = Green
> for the 2nd row i need:
> Cell1 = Yellow
> Cell2 = Blue
> Cell3 = Green
> Cell4 = Green
> for the third row in need:
> Cell1 = Red
> Cell2 = Yellow
> Cell3 = Blue
> Cell4 = Blue
> and finally for the forth row i need:
> Cell1 = Red
> Cell2 = Red
> Cell3 = Yellow
> Cell4 = Yellow
> Does anybody know a way setting these to the desired colours?
> please help!!!!!!
> --
> Thanks in advance,
> Dave Hunt|||Thanks for you help, having a look in the Hitchhikers guide now.
i have tried that but i will give it another go
cheers
dave
--
Thanks in advance,
Dave Hunt
"Catadmin" wrote:
> Oh, I forgot to mention, this is to get alternating rows of color. You'll
> have to play with it to get specific cell colors. Also, look up RowNumber()
> function in BOL.
> Catadmin
> --
> MCDBA, MCSA
> Random Thoughts: If a person is Microsoft Certified, does that mean that
> Microsoft pays the bills for the funny white jackets that tie in the back?
> @.=)
>
> "DustpanDave" wrote:
> > Hi All
> >
> > I have a matrix that goes no bigger than 4 colums and 4 rows big.
> >
> > I need to have different colours for certain cells within the matrix.
> >
> > e.g for the first row, i need:
> >
> > Cell1 = Yellow
> > Cell2 = Blue
> > Cell3 = Green
> > Cell4 = Green
> >
> > for the 2nd row i need:
> > Cell1 = Yellow
> > Cell2 = Blue
> > Cell3 = Green
> > Cell4 = Green
> >
> > for the third row in need:
> > Cell1 = Red
> > Cell2 = Yellow
> > Cell3 = Blue
> > Cell4 = Blue
> >
> > and finally for the forth row i need:
> > Cell1 = Red
> > Cell2 = Red
> > Cell3 = Yellow
> > Cell4 = Yellow
> >
> > Does anybody know a way setting these to the desired colours?
> > please help!!!!!!
> > --
> > Thanks in advance,
> > Dave Hunt|||Perfect, thanks also :-)
This is a problem I've been having and how have it fixed :-)

No comments:

Post a Comment