Main Content   Site Accessibility
home
Dec 18
Set up a traffic light display in SharePoint 2010

SharePoint 2010 traffic lightsMy employer asked if I could set up a traffic light display in SharePoint 2010 to show when there was a need for staff re-training.

Basically the traffic light needed to show three separate states – (1) fully trained (Green), (2) six months before retraining is needed (Amber) and (3) when training is finally due or even passed its final date (Red).

I began developing the various lists to hold dates and times, which included the Training Date, Renewal Warning and Renewal Date and all these worked a treat and showed the expected results.

As soon as I began to use the Today() function in a calculated field such as ‘IF(TODAY()>=[Renewal Warning]‘ to start developing the traffic lights, SharePoint threw up an error “Calculated columns cannot contain volatile functions like Today and Me”.

I searched for a solution and found a SharePoint trick that allows you to use Today() in calculated columns – http://abstractspaces.wordpress.com/2008/05/19/use-today-and-me-in-calculated-column/. There is still a problem however, as the results of the calculation are not automatically updated day by day. The calculated value only updates when you edit and save the list. This method has too many limitations, especially if you end up with a large SharePoint list, like the one I will be coding for.

Further searches revealed some possibilities using the likes of PowerShell  and  Microsoft SharePoint Designer. None of these solutions were ideal from my point of view, especially as my employer frowns upon some of these approaches.

After further research I finally stumbled across a very useful script that produces the traffic light display I was looking for. Rather than using Today() the script grabs the servers system date and compares it to a due date.

So in addition to my other columns I created a new column called DueDate with a calculated Field that works out the Training Date, and has a Data Type of Date and Time (date only). I then created another calculated column called Training Indicator and in the Formula Box I put =IF(DueDate=””,”N/A”,”Due: “&MONTH(DueDate)&”/”&DAY(DueDate)&”/”&YEAR(DueDate)). The Data Type for this column has to be Date and Time.

The next step was to use the script to produce the correct date comparison and the traffic light display I was looking for. Grab the script from Path to SharePoint http://blog.pathtosharepoint.com/2008/11/24/countdowns-a-second-method/. This script needs to be added to the List used to produce the traffic light display. In my case this was my Training List. You do this by adding a Content Editor Web Part to the list where you’ll place the script in the HTML view. If you have trouble in placing a CEWP on your list try adding ?&ToolPaneView=2 after /Allitems.aspx and then click the Page tab and all the editing tools will appear. Select Insert and choose Web Part, and from the Media and Content Category choose the Content Editor.

Note: Make sure you place the CEWP below the list on the page by adjusting its Layout/ZoneIndex to something like 50 or 100.

Click on the CEWP and in the top menu select Page and then selct Format Text from the Editing Tools section. Now select HTML and from the drop down list choose Edit HTML Source. In the resulting Source Box place the Script that you got from Path to SharePoint (see above). Now save and exit. Your traffic lights should now display.

The traffic lights that display have nice mouse overs that show due and overdue dates. The script unfortunately uses the American date display of Month, Day and Year. In the UK amend the free scripts ‘frendlyFieldDate’ as follows – var frendlyFieldDate = d + “/” + m + “/” + y;

This wonderful script added to the HTML Source works a treat for my SharePoint 2010 Training List. I hope it helps you as well.

Major thanks has to go to Chris and Alex, the developers who came up with this solution.

Aug 1
Creating a new Table Style in SharePoint 2010

When you decide to create a table in Sharepoint 2010 you will already be in Page Edit Mode where you can click on the page and select Insert from the Editing Tools Tab.

Populate your new table with at least 4 to 5 columns and around 7 or 8 rows as this will let you to test all of the allowable styles when you create your new Custom SharePoint Table.

Now place your cursor inside the table so the Table Tab appears and then choose Design which gives you choice of options.

In the Design Tab it would be a good idea to check all 4 checkboxes for the style (header row, footer row, first column, and last column).

Now click on Styles and you will see three styles that you can apply to your table:

Table Stye 1 – Clear

Table Style 2 – Light Banded

Table Style 3 – Medium Two Tone

So lets set up a new Table Style using CSS.

To create a new table style, you have to declare a CSS class in your CSS page that starts with ‘table.ms-rteTable-’ and ends with the name of your new table. Within the class you must set a CSS property that SharePoint will see called ‘-ms-name’. This will set the human-readable name of the table style. See the following example:

table.ms-rteTable-newtable {-ms-name: “Custom SharePoint Table”;}

Once you have put this in your CSS Style Sheet, refresh your page and click Edit and go to the ‘Design tab’ for your table. Now you should now see your custom table style at the bottom of the list, but it has no styling attached to it as yet. So lets style this new ‘Custom SharePoint Table’.

SharePoint Table StyleThe following CSS snippet produces a table that has no border, has an orange header and a dark grey footer; a light grey border on the bottom of each row; and when you hover over the ‘even rows’ they turn light grey and the ‘odd rows’ turn pale yellow.

table.ms-rteTable-newtable {-ms-name: “Custom SharePoint Table”;}

.ms-rteTable-newtable td, th.ms-rteTableFirstCol-newtable, th.ms-rteTableFooterFirstCol-newtable {padding:10px; text-align:center; border-bottom:1px solid #ccc;}

.ms-rteTableHeaderRow-newtable th {background: #f16d2d; color: #fff; padding: 10px; text-align: center; font-size: 20px;}

.ms-rteTableEvenRow-newtable:hover {background: #EFEFEF;}

.ms-rteTableOddRow-newtable:hover {background: #FFFFCC; }

.ms-rteTableFooterRow-newtable td, th.ms-rteTableFooterFirstCol-newtable {padding: 10px; border-top: 1px solid #ccc; background: #555555; font-size: 18px; color: #fff;}

So that’s your completed Table Style. Just amend the CSS to choose your own particular colour scheme.

Below is a list of all the available table styles

/* .ms-rteTable-XXXXX
.ms-rteTableHeaderRow-XXXXX
.ms-rteTableHeaderFirstCol-XXXXX
.ms-rteTableHeaderLastCol-XXXXX
.ms-rteTableHeaderOddCol-XXXXX
.ms-rteTableHeaderEvenCol-XXXXX
.ms-rteTableOddRow-XXXXX
.ms-rteTableEvenRow-XXXXX
.ms-rteTableFirstCol-XXXXX
.ms-rteTableLastCol-XXXXX
.ms-rteTableOddCol-XXXXX
.ms-rteTableEvenCol-XXXXX
.ms-rteTableFooterRow-XXXXX
.ms-rteTableFooterFirstCol-XXXXX
.ms-rteTableFooterLastCol-XXXXX
.ms-rteTableFooterOddCol-XXXXX
.ms-rteTableFooterEvenCol-XXXXX */

Jan 10
SharePoint Foundation 2010 Installation Problems

SharePoint Foundation 2010 installThere are many posts about installing SharePoint Foundation 2010 on a Windows 7 PC but this is my own personal experience and shows how I had to overcome quite a few hurdles before getting SharePoint installed and running on my own copy of Windows 7.

First up, this installation is for testing purposes only. So keep in mind that this is just a standalone environment for developing SharePoint solutions and is not meant to be a full scale production platform.

This installation requires that you use a 64 bit operating system – either Windows 7 or Windows Vista.

I do not want to regurgitate the many blog posts and sites that breeze through the installation of SharePoint Foundation 2010 on Windows 7 or Vista. In fact I found the Microsoft article on installing SharePoint perfectly suitable as long as you know your DOS commands. Check it out for yourself – http://msdn.microsoft.com/en-us/library/ee554869%28office.14%29.aspx.

The Prerequisites

However, before you can even start to install SharePoint Foundation 2010 you must download and install a number of so called prerequisites. You cannot use the built in prerequisite tool because the default installation works only for Windows Server 2008. This means you have no choice but to install the prerequisites manually.

If you are using Windows Vista Service Pack 1 or Windows Vista Service Pack 2, you must install the following prerequisites:

1. .NET Framework 3.5 SP1
2. Windows PowerShell 2.0
3. Windows Installer 4.5 Redistributable

If you are using Windows Vista Service Pack 1, Windows Vista Service Pack 2, or Windows 7, install the following additional prerequisites:

1. Microsoft FilterPack 2.0. This can be installed by opening a command prompt and typing the following: c:\SharePointFiles\PrerequisiteInstallerFiles\FilterPack\FilterPack.msi.

(To open a C: prompt – Click Start and type command into the search programs and files search box. Right click the Command Prompt at the top of the search result and select Run as administrator.)

2. Microsoft Sync Framework
3. SQL Server Native Client
4. Windows Identity Foundation (KB974405)
5. WCF hotfix (KB971831) for Windows 7
6. ADO.NET Data Service Update for .NET Framework 3.5 SP1

Required Windows Features

Next enable each of the required Windows Features. The quick way to do this is by copying and running the following command in a Command Prompt window.

start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;^
IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;^
IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;^
IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;^
IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ManagementScriptingTools;^
IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;^
IIS-RequestFiltering;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;^
IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-IIS6ManagementCompatibility;^
IIS-Metabase;IIS-WMICompatibility;WAS-WindowsActivationService;WAS-ProcessModel;^
WAS-NetFxEnvironment;WAS-ConfigurationAPI;WCF-HTTP-Activation;^
WCF-NonHTTP-Activation

After Running the Code

Once you’ve copied and pasted the above code make sure all prerequisites are met and no critical error is present in your computers event logs.
If you have any problems installing SharePoint Foundation 2010 from here on check that all the required Windows Features are enabled.

The command in the previous step enables all of the required features in the Internet Information Services section of the Windows Features dialog box (which you can access through the Programs section in Control Panel).

The Installation

When all the above downloads are installed download SharePoint Foundation 2010 from the Microsoft website.

Place the SharePointFoundation.exe file into a folder on your C drive named SharePointFiles i.e. C:\SharePointFiles

Now you have to extract the SharePointFoundation.exe program files so you can access and amend a single configuration file.

To do this open a C: prompt – Click Start and type command into the search programs and files search box. Right click the Command Prompt at the top of the search result and select Run as administrator.

Here’s where some people have a problem as you are usually dumped at C:\Users\Name and you need to be at C:\. Just type CHDIR.. to move up a rung and CHDIR.. to end up at the C:\ prompt.

Now copy the entry below and paste it immediately after the C:\ prompt.

SharePointFiles\SharePointFoundation /extract:c:\SharePointFiles

This assumes SharePoint Foundation is installed and placed on your C: drive in a folder called SharePointFiles and is named SharePointFoundation.exe, otherwise you need to change paths accordingly.

Once the files are extracted go to the c:\SharePointFiles folder and you will see a list of files.

Open the Files folder and then the first Setup folder and right click on the config.xml file and select Edit. This will open the configuration file in Notepad.

Now add the following setting Id as the last entry before:
</Configuration>

<Setting Id=”AllowWindowsClientInstall” Value=”True”/>

This line of code above gets SharePoint Foundation 2010 to install on a 64 bit edition of Windows.

The entire config.xml file should look something like this:

<Configuration>
<Package Id=”sts”>
<Setting Id=”SETUPTYPE” Value=”CLEAN_INSTALL”/>
</Package>
<DATADIR Value=”%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\14\Data”/>
<Logging Type=”verbose” Path=”%temp%” Template=”Microsoft SharePoint Foundation 2010 Setup *.log”/>
<Setting Id=”UsingUIInstallMode” Value=”1″/>
<Setting Id=”SETUP_REBOOT” Value=”Never” />
<Setting Id=”AllowWindowsClientInstall” Value=”True”/>
</Configuration>

Now save and close the Notepad file.

Once you’ve completed all the above steps go back to the SharePointFiles folder and run the setup.exe program to install SharePoint Foundation 2010.

On the Choose the installation you want page, click Standalone to install everything on one developer workstation. After the installation is complete, you are prompted to start the SharePoint Products and Technologies Configuration Wizard.

Once the installation is complete you should see the Central Administration page.

Blank Pages and the Solution

This is the next potential problem, as I got a blank page at this point. Even after a reboot and going to Start/All Programs/Microsoft 2010 SharePoint Products and clicking on SharePoint 2010 Central Administration I still got a blank page.

After some online research I found that this problem is to do with the setup of host names and/or problems with the loopback check.

According to Microsoft there are two methods to work around this blank page issue and you should use one of the following methods – the one that’s most appropriate for your particular set up.

Method 1: Specify host names (The preferred method if NTLM authentication is desired)

To specify the host names that are mapped to the loopback address and can connect to Web sites on your computer, follow these specific steps:

Click Start, click Run, type regedit, and then click OK. In Registry Editor, locate and then click the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0

Right-click MSV1_0, point to New, and then click Multi-String Value. Type BackConnectionHostNames, and then press ENTER.

Right-click BackConnectionHostNames, and then click Modify. In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.

Quit Registry Editor and then restart your PC to see if you can log in to SharePoint Central Administration.

Method 2: Disable the loopback check (less-recommended method)

The second method is to disable the loopback check by setting the DisableLoopbackCheck registry key.

To set the DisableLoopbackCheck registry key, follow these steps:

Click Start, click Run, type regedit, and then click OK. In Registry Editor, locate and then click the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

Right-click Lsa, point to New, and then click DWORD Value. Type DisableLoopbackCheck, and then press ENTER.

Right-click DisableLoopbackCheck, and then click Modify. In the Value data box, type 1, and then click OK.

Quit Registry Editor, and then restart your computer.

If you now get a log in page that will not accept your windows password this last step should help.

First go to User accounts and make sure you have a password set for your Administrators account. If not create one and then restart your PC.

Now run the SharePoint 2010 Product Configuration Wizard again and try to open SharePoint 2010 Central Administration.

Password not Accepted

If you now get a log in page that will not accept your windows password this last step should help.

First go to User accounts and make sure you have a password set for your Administrators account. If not create one and then restart your PC.

Now run the SharePoint 2010 Product Configuration Wizard again and try to open SharePoint 2010 Central Administration.

If your password is still not accepted you will need to enable Basic Authentication under the sites section of Internet Information Services (IIS). To do this open Internet Information Services (IIS) and expand the Sites section. If you do not know where to find IIS just copy Internet Information Services and paste it into the Windows Search programs and files box. Click on the resulting link.

In the left hand column of IIS click the arrow to open up Application Pools and the Sites folder. Open the Sites folder and select SharePoint Central Administration and click on Authentication under the IIS Group in the right hand panel. Next on the Authentication screen enable “Basic Authentication” by right clicking and selecting Enabled.

Now restart your PC and see if you can now log in. If not run the SharePoint 2010 Product Configuration Wizard again. And then try to open SharePoint 2010 Central Administration.

By following all these steps I was finally able to get SharePoint Foundation 2010 set up as a testing server on my 64 bit Windows 7 Professional PC.

The only downside is that I now have to log in every time I start up my computer!

 

P.S. This whole process with pictures and an even fuller explanation is available as a Free eBook.

 

   

XHTML CSS    Copyright © QBS Web Design 2007/2014   Powered by Fast2Host Professional Hosting    Legal Stuff     Top of Page