7 Minute Screencast: Color code a SharePoint Calendar – Update
- SharePoint Color Coded Calendar – The PayRoll Schedule
- Screencast: Color Code a SharePoint Calendar – The PayRoll Schedule
- 7 Minute Screencast: Color code a SharePoint Calendar – Update
In this screencast, Jim Bob Howard continues his examination of different techniques for color coding a SharePoint calendar. The techniques used here are of a more generic nature than the initial treatment.
- SharePoint Color Coded Calendar - The PayRoll Schedule
- Screencast: Color Code a SharePoint Calendar - The PayRoll Schedule
- 7 Minute Screencast: Color code a SharePoint Calendar - Update
- Color-coded SharePoint Calendar with Lookup DateTypes
- Update: SharePoint Color Coded Calendar – PayRoll Schedule
Just to clarify… use this method if you don’t have a common character in a unique location in your DateType choices.
Thats cool Jim Bob! I’d definitely use that, I think I would also add a CEWP at the top of the calendar view with the color code key so that peopel can refer to that as an instant reference. Nice screencast, thanks.
Great information but will this work in WSS 3.0? We hope to up-grade to MOSS sometime this year.
Yes, it works with WSS. That’s what we use.
Frank,
For future reference, the solutions in all screencasts on this site can be implemented in WSS unless otherwise noted.
Mark
Jim Bob, have you checked out my formula generator? It should help a lot in the formula building process, even though some fine tuning will be necessary to replicate your example.
Here is the link:
http://www.pathtosharepoint.com/HTMLcc/default.aspx
Yes, Christophe, I like what you’ve done there. That can be a great starting point for creating the Color and BGColor columns. It would certainly help with first-timers creating nested IF statements.
Well done!
Jim Bob: the formula generator is not just for first-timers. This may surprise you, but actually most of the requests for help I receive are from people who simply forgot a quote or a parenthesis in the formula!
Hi Jim,
I’m relatively new to SharePoint but I’ve been looking at a way to colourised a SharePoint calendar for a while. Ideally, I would like to be able to combine this with the Team Master Calendar, arranged by Mark Miller.
What I would like to be able to do is allow user to connect their Outlook calendar to a team/individual calendar in SharePoint, then combine these into a team view and colour code entries based on their team designation.
I can see this being a lot of work, but wonder if there is a way to do this?
Cheers.
I have posted an updated solution for a color-coded calendar that uses a lookup list for DateTypes.
Hi, I have created my columns according to the 7 Minute Screencast: Color code a SharePoint Calendar – Update, everything is fine except, my display actually displays the CSS code with variables replaced. I cut the CSS out and put it in regular HTML and it works. Any ideas on what I am doing incorrectly?
This is what displays
PD
Here is the code
=”"&Status&”"
Ok, so you cannot see the code, how do I send that to you?
Mark should be able to make it visible here.
But in the meantime, try posting it as a comment on my blog.
Jim Bob,
Here is how it looks (going to try making it visible with CSS comment)
Code I used
/* =”"&Status&”" */
What was displayed
/* WFH */
Thanks Jim Bob, this has been very useful. I never would have been able to figure out anything like this on my own. Your solution is working pretty good for me, with two exceptions I’m hoping you will be able to help me resolve. First understand I’m not a sharepoint admin, I’m only a a user creating a team site (But I have full control to that team site). The first problem I am having is that multiple day events are displaying correctly with the correct color, but single day events (Days with the same from and to date) show the code that is in the Display field rather than the banner. The second is that I lost the ability to click on the text in that banner box to bring that record up in display mode. Thanks in advance for any advice.
Thank you for a very handy solution! I’ve set up a calendar on my site and have it running, but am experiencing an issue with the week view. It seems to work propoerly for multi-day events (as Tim reports), but single day events do not render with the selected colors and only show the start time. Any ideas as to why Week view would not work. Thanks again!
An update to my earlier post yesterday…I found another posting indicating that I should replace the DIV with SPAN and that seemed to work a little better. It appears that most of issues revolve aroung the fact that I created my own start and end dates (Dates Only). What I have is a calendar that has multiple content types (On Call, Vacation, Holiday, etc.) I set my time intervals for the calendars to be the date fields I created, but on the display it never shows the end date i.e. If I had a start of 7/21 and end of 7/28 it shows on the calendar spanning 7/21-7/27. I’m assuming that this has to do with the fact that the end date field is 7/28 12:00am and not the 7/28 11:59pm I would want. I’ve created new hidden end date field that will add time to the user entered end date field so that I have a behind the scenes end date field of 7/28 11:59 pm but then the calendar function won’t let me use that calculated date in its time interval. I’m lost as to what to try next.
Hi Tim,
that’s right, I have recently replaced div tags with span tags in the calendar tutorial, to get cleaner html:
http://pathtosharepoint.wordpress.com/2008/11/15/sharepoint-calendars-color-coding-hover-effects-etc/
I also recommend that you check out this post, it lists known issues with SharePoint calendars:
http://pathtosharepoint.wordpress.com/2008/11/13/issues-with-calendars/
In particular you’ll notice that SharePoint calendars don’t like calculated dates.
Christophe
Thanks Christophe, I had read both of those posts and that’s where I got the change from DIV to SPAN…Good stuff by the way, sure glad you guys take the time to post your expertise…My problem that I’m attempting to resolve is that events that are multi day show one day less on the month calendar (I.E. if a user says they are taking vacation monday 7/26 thru Wednesday 7/28 it’s only showing the bar on 7/26 and 7/27). To further compound the issue on days that you have multiple events occurring (Both single day event and multi day events that span that date) and you click on the 1 day view, the multi day events display nicely but cover up the single day events which also have the stupid 12:00 AM information attached to them. Was just hoping that somebody had this issue and had resolved it. I’m personally not a developer and cannot read HTML or JAVA or anything, but I have looked at the source code for the calendar and it just seems to me that using the techniques you guys are using here that the ColSpan could be bumped up by 1(taking into account some nifty coding for multi row events), or the class for single day changed to muworkitem or width=”100%” or whatever it would take to make it display correctly. Appreciate anyones advice and help on this.
I don’t see that anyone has experienced this issue so I thought I’d ask. Everything works great for me, all views, my events color coded per department and clickable. But on all the scheduled events I’m seeing the calendar’s default color and border around my events. How do you turn off that defaults to let only the custom ones show?
Can someone PLEASE HELP? For the life of me I cannot get the colors to work for me. I would like to use the green, yellow, blue and red. I learn better with visual aids. Can someone can send me screen shots of the ‘step-by-step’ process. You can contact me at [email protected]
Thanks
I have found this to be very helpful but there is apparently a limit to the number of different colors you can enter. It looks like the limit is 7. We need 10.
Is there a work-around for this?
Thanks
Sure, Fey, look at:
Color-coded SharePoint Calendar with Lookup DateTypes
http://www.endusersharepoint.com/?p=1721
There shouldn’t be a limit there. The 7-color limit you mention is due to the limit on the number of nested IF statements SP allows, with the Lookup DateTypes approach doesn’t use.
Hope that helps.
Blessings,
Jim Bob
Hi, everyone,
My apologies if this is addressed in the screencast (unfortunately, it’s blocked by our network), but I’ve been able to successfully color code my calendar based on a Category field within the calendar. Love the formula generator, Christophe – thanks! However, I actually need to color code my calendar by content type (and for one instance, by a particular field within a content type). I’m not a programmer by any means, so I’m unsure how I would adapt the basic principles to point to different content types instead of a single column. Is this doable OOTB, or would I need to use SharePoint Designer?
Thanks as always!
Content Type is one of the columns in your data. When using a calculation column for your colors, simply include Content Type in the mix.
Blessings,
Jim Bob
Thanks, Jim Bob! As soon as I’d posted the question, I realized that content type was an option! However, now I’m running into a problem with the view of the calendar itself – the calendar needs to display the Trainers field, which is a “Person or Group” field that’s pulling from a SharePoint group. The field was set up so that multiple trainers could be assigned to an event (and the managers need to see in the calendar view that multiple trainers are assigned, so having a separate field for a second trainer may not be an option). However, when I try to update the code to pull from the Trainers field, it’s not listed as an available column in the calculated column setup, and I get an error if I try to type it in manually (the error message says, “One or more column references are not allowed, because the columns are defined as a data type that is not supported in formulas.” Do you know of a way around this snag or an alternate way I could set up the columns/content types?
I can’t thank you enough for your help!
Sure, Lynley. You’re going go into SharePoint Designer 2007 and create a workflow that can populate the field the way you need it.
If you need some help with that, please post it to Stump the Panel, so that others will be able to find it easier. ;)
Blessings,
Jim Bob
I figured Designer would probably be the answer ;0) I actually posted to STP right after I posted here the first time – I’ll give it a shot, and if I need additional help, I’ll post there.
Thank you so much!
Hi Jim,
I successfully created the color coded calendar, but for given days I am getting “more items”, when I expanded monthly calendar, calendar did not display those items and still saying that “more item” for that given day, what could be reason.
Could you please help.
Thanks
Mas
Mas,
I haven’t seen that problem. Perhaps Christophe could answer that. How many items do you have per day on those with the “more items” link?
Blessings,
Jim Bob
I tried to use standard list calendar as well as Event calendar and for some month even items are not more than 100.
Thanks for help.
Masood
I applied this method to our existing training calendar. It worked, but in a limited way. It allows only 8 DataType (9 is reserved for “everything else”). Are you aware of that? We certainly have more than 8 types of training. What’s your suggestion for a solution? Secondary, this color coded calendar shows only the “Display” calculated field, instead of “Title”, any event the user does not select from the predefined DataType (TrainingLabel in our case)list will be blank, that’s not good, we want some text there. Besides, one Traininglabel could have more than one variation to describe the location and/or group #, “Display” field won’t reflect that detail. What part of script should I change to have the color coded calandar display the Title field rather than the Display field?
Thanks!
Jim, here I am again. Sorry for the first question, I should have read the thread before I post. So you are aware of it and had a solution already. It can’t work for me though, as I do not have SharePoint Designer. So I am stuck with 7-number limit or 8-number limit?
Yong Hui,
What may work for you is to combine a couple of display fields. (Oh, and the reason for the Display field is to build the HTML needed to show the colors. You can include the Title in that calculated field if you choose.)
Nested IF Statements
To combine fields, you may have to create multiple “Color” fields:
Color1 : =IF(Type=A,red,IF(Type=B,blue, … IF(Type=H,green,”"))))))))
Color2 : =IF(Type=I,yellow,IF(Type=J,orange, … IF(Type=P,purple,”"))))))))
…
If you do it this way, you could conceivably include 65 colors (8 x 8 + 1 default), by creating a FinalColor…
FinalColor : =IF(Color1!=”",Color1,IF(Color2!=”",Color2, … IF(Color8!=”",Color8,DefaultColor))))))))
CHOICE Statement
Another option would be to assign a number to each Training Type in the same way.
Color1 : =IF(Type=A,1,IF(Type=B,2, … IF(Type=H,8,0))))))))
Color2 : =IF(Type=I,9,IF(Type=J,10, … IF(Type=P,16,0))))))))
…
ColorChoice : =Color1+Color2+Color3+…+ColorN
Then you could use a CHOICE statement like this:
FinalColor : =IF(ColorChoice=0,DefaultColor,CHOICE(ColorChoice,red,blue,yellow,green,orange,purple,chartreuse, … fuschia))
Let me know if that helps.
Blessings,
Jim Bob
Hi Jim Bob
Your site has been very helpful with the calendar function. I’ve been using if for time off request.
I currently have different color for each department and using workflow.
I was wondering if you can help me figure out how to make the calendar color red when someone takes the same time off. Bascially I want to quickly be able to see if there’s a risk if someone is out the same day or around the same time.
Hi Jim,
Thank you for taking the time to help out, sorry for my delay.
I created another calendar to try out your method. The new fields finally all passed the syntax. It turned out SharePoint does not take color names, only hex numbers are acceptable. Nor does it like color1! etc. So I used your second option. What I got eventually is #Value displayed throughout my calendar, with no colors. I believe I am very close, just couldn’t figure out where I had it wrong. I have:
Label (for drop down choices)
Color1 (the rest are calculated)
Color2
ColorChoice
FinalColor
Display
BGColor1
BGColor2
FinalBGColor
Jim, I know you are very busy. If you think you can still help, I can email you the formular scripts. Thanks a bunch anyway!
Please disregard my prior posting. I had it working!! It is exciting I have endless choices to color my calendar. Jim, you are great, so very helpful.
Yonghui
Good job, Yong Hui! That was fast! I was just emailing you to ask you to send your calculated columns.
Glad you got it working!
Does anyone know how to achieve this in 2003. Problem is calendars only display the Title field
Mas,
Have you found a solution? We’re having the same problem.
Items won’t show on the month view for 11/12 but do show on the day/week view.
- Leo
Leo, see my earlier comment (21). Follow the links to get a list of SharePoint calendar issues and some workarounds (see in particular the Microsoft links).
I have tried this way and I have tried Christophe’s way. Neither way is giving me results. Can someone please help? I just keep getting the default colors.
I have attempted to implement the solution mentioned above and when I modify the view to show the display i see “[Activity Type]” across the calendar where users have created calendar events. I have used Activity Type in place of date type mentioned in the above screen cast. Thank you in advance for your assistance.
I’m having trouble creating the Date Choice column. When I create it, it doesn’t have a place to insert the formula. Does anyone know what I’m doing wrong?
Text for content editor webpart link to Christophers site does not provide WHAT to put in it. HELP! I re-built and now just need the CEWP info.
Sandy – Go to Christophe’s forums on Stump the Panel. He checks in daily. — Mark
I have implemented all the steps for my color coded calendar – but the colors do not display. Everything in my calculated columns passed syntax.
Here is the syntax used:
DayChoice: =IF(CircDayType=”Regular Full Run”,1,IF(CircDayType=”Bonus Day”,2,IF(CircDayType=”Exception Day”,3,4)))
Color: =CHOOSE(DayChoice,”#008000″,”#800000″,”#800080″,”#008080″)
BGColor: =CHOOSE(DayChoice,”#ccffcc”,”#ffccff”,”#cccccff”,”#ccffff”)
Post this to Christophe’s forum on Stump the Panel and you’ll get a quicker, and more complete, response.
Hey Jim,
Nice screencast..very helpful. Trying to apply this concept to a Change Calendar where Impact Type is color coded. Having an issue with the colors appearing. Did everything like in your screen cast. If I open up a calendar item, the Display shows correctly. If I copy and paste the code that was compiled in a calendar entry into an htm, it seems to open and display correctly in a browser. So not sure why the colors aren’t coming through in my calendar views. I have put together some screenshots to show what I’ve done with the List columns. I can send to someone that is willing to help. Any help is appreciated!