SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Banded Column Colors


Banded Column Colors

Author
Message
restie
restie
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 29
Hi
I have a data set that shows employees, dates, and sales

Employee........Date..............Sales
Raul...............2013-12-01.....100
Raul...............2013-12-02.....150
Raul...............2013-12-07.....350
Jose...............2013-12-01.....150
Jose...............2013-12-05.....100
Jose...............2013-12-06.....50
Pedro.............2013-12-04.....100
Pedro.............2013-12-07.....400

(i dont know how to format a table)

I want a report to look like

..............2013-12-01.....2013-12-02.....2013-12-03.....2013-12-04.....2013-12-05.....2013-12-06.....2013-12-07
Raul........100................150.......................................................................................................350
Jose........150.................................................................................100................50
Pedro.......................................................................100............................................................400

So I have a column group on dates
and I have a row group on employee

I want to be able to color the weekend a different color than the weekdays.

What I've been doing so far is, I have an expression per cell to set the background color. If the day of the week is 1 or 7, color it red, else blue.
The problem I have is that, if I have no data for that day for that person, I can't get the red.
For example, Pedro on 2013-12-01. He has no row/data for that day so that cell wont get colored red.

Any suggestions?
David Burrows
David Burrows
SSCrazy Eights
SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)

Group: General Forum Members
Points: 9511 Visits: 9740
The value should not matter as you are testing the date for the column.

Please post the expression you are using.

An example would be

=Choose(Weekday(Fields!Date.Value),"Red","Blue","Blue","Blue","Blue","Blue","Red")


Far away is close at hand in the images of elsewhere.

Anon.


restie
restie
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 29
I'm using
=iif(Weekday(Fields!Date.Value)=1 OR Weekday(Fields!Date.Value)=7 ,"red", "Blue")
The expression you posted is doing the same thing.

Is there a way I can get the value of the column when I have no data for that cell?
Is there a different way to set the color that affects the entire column instead of doing all the cells individually?

Thanks
David Burrows
David Burrows
SSCrazy Eights
SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)SSCrazy Eights (9.5K reputation)

Group: General Forum Members
Points: 9511 Visits: 9740
Is there a way I can get the value of the column when I have no data for that cell?


Why?
Because you are using a matrix when you apply fill to the cell it applies to the whole column unless you specifically write the expression to do otherwise.

Is there a way I can get the value of the column when I have no data for that cell?

If the cell has no data then the value will be Nothing, ie =IsNothing(Fields!Sales.Value) will yield true
You can use this in the Fill expression if, for example, you wanted the background to white if no value.


Far away is close at hand in the images of elsewhere.

Anon.


ndiro
ndiro
Valued Member
Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)

Group: General Forum Members
Points: 64 Visits: 216
Try this:

=IIF(Weekday(ReportItems!HeaderDate.Value) = 1 Or Weekday(ReportItems!HeaderDate.Value) = 7,"Red","Blue")

and remember to change HeaderDate with the textboxId of the columnGroup

Let me now if it works
Attachments
Report.png (12 views, 12.00 KB)
restie
restie
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 29
Yup that worked.
Thanks! Now on to next set of problems.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search