I am trying to change the background colour of a textbox in a table to
display one colour if the value is null and another if there is a value. The
data is an integer type and when using isdbnull the colour displayed for the
null value columns is the colour for a value, not the null colour. If am
using '=nothing' it is displaying the null colour for the values of 0.
I am using RS 2000 SP2Try using the VB.NET syntax of 'is nothing' instead of '=nothing'
Matt A
Showing posts with label colour. Show all posts
Showing posts with label colour. Show all posts
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 :-)
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 :-)
Background colour
hi there ,
if a question abot ms report server.
i have two fields ,
field1 : name = gender value = 1 for men and 2 for woman
field 2 : name = lastname value = for example "jenkins"
so what i want to do is if gender = 1 (men) then i want to set the background colour of the field2(name) blue
else (gender = 2) i want to set the background colour of the field2(name) red.
do anyone know how i could do this ??
i'am a "newcommer" in the world of reporting services ,i always used crystal report for creating my reports.
thanks
patrickHi,
Here is a trick but most of programmers do not recommend it (Me too).
You fire the query as
Select [Name]=(Case When Gender=1 then '<font style=''backgroundcolor:blue;''>' + lastname + '<font>' Else '<font style=''backgroundcolor:red;''>' + lastname + '<font>' End )
Remember this is not recommended but you can use it in urgency.
Regards,
Hemchand.|||
if a question abot ms report server.
i have two fields ,
field1 : name = gender value = 1 for men and 2 for woman
field 2 : name = lastname value = for example "jenkins"
so what i want to do is if gender = 1 (men) then i want to set the background colour of the field2(name) blue
else (gender = 2) i want to set the background colour of the field2(name) red.
do anyone know how i could do this ??
i'am a "newcommer" in the world of reporting services ,i always used crystal report for creating my reports.
thanks
patrickHi,
Here is a trick but most of programmers do not recommend it (Me too).
You fire the query as
Select [Name]=(Case When Gender=1 then '<font style=''backgroundcolor:blue;''>' + lastname + '<font>' Else '<font style=''backgroundcolor:red;''>' + lastname + '<font>' End )
Remember this is not recommended but you can use it in urgency.
Regards,
Hemchand.|||
Hello:
Is Gender ALWAYS a 1 or a 2?
In the field (Field2:name=LastName) within Report Layout - Select Properties (Right Side under Solutions Explorer) -
Click on BackGround (you will get a down arrow and scroll and look for Expression - Expressions is always at the top of the list)
In the Expression Box enter the following:
=iif(Field!:Gender.Value = "1", "Blue", "Red")
I probably do not have your field named correctly but you can enter =iif(THEN SELECT YOUR FIELD FROM THE DATASET and then append the remainder of the above statement.
Hope this helps!
Best Regards,
Joe
Subscribe to:
Posts (Atom)