Monday, June 25, 2007

IE Hangs when opening Address Book from sharepoint

This is only an issue if you are using dual displays. The problem is: if you open your address book from the second monitor IE stops responding and you are not prompted to allow IE access to your address book. The simpile solution is move your browser window on to your main display and reopen the address book. Problem solved. Issue occured using Office 2003 with IE 6 or 7. havent tested with office 2007 yet.

Tuesday, May 1, 2007

APAC Sharepoint Conference

I am now officially booked in for the Conference http://www.microsoftsharepoint.com see you there.

Tuesday, April 24, 2007

Conditional Formatting on a Sharepoint List View

When using the sharepoint list view there is no way to have conditional formatting unless you convert it to a XSLT view within frontpage. Unfortunately when you do this you loose some features which you had eg. count. There are some issues with the filter functionality in the xslt web part. I have written some javascript which allows you to do conditional formatting on the client side. Just add it to a content editor web part after the view.

I will paste the javascript here shortly
As Promised
<script>
/*******************

Copyright (c) 2007 Tim Leyden

This script can be used freely as long as all

copyright messages are intact.

********************************/
function format(textconfieldname, textcondition,formatfieldname,openformattag,closeformattag,tableid,islookupfield){

var cfindex; //the cell index of condition field
var ffindex; // the cell index of format field

var array = document.getElementsByTagName('th');
for (i=0;i<array.length;i++){
if(array[i].innerText != null){
//alert(array[i].cellIndex +" "+ array[i].innerText.substr(array[i].innerText.length-textconfieldname.length,textconfieldname.length));
if(array[i].innerText.substr(array[i].innerText.length-textconfieldname.length,textconfieldname.length) == textconfieldname){
cfindex = array[i].cellIndex;
}
if (array[i].innerText.substr(array[i].innerText.length-formatfieldname.length,formatfieldname.length) == formatfieldname){
ffindex = array[i].cellIndex;
}
}

}

var table = document.getElementById(tableid);
var rows = table.rows;
for (i=0;i<rows.length;i++){
var cells = rows[i].cells;
if (cells[cfindex]!=null){
if (cells[cfindex].innerHTML == textcondition){
var name = cells[ffindex].innerHTML;
if(islookupfield){
name = name.replace (/self>(.*)(<\/A>)/,"self>"+openformattag+"$1"+closeformattag+"</a>");
cells[ffindex].innerHTML = name;
}else{
cells[ffindex].innerHTML = openformattag+name+closeformattag;
}


}
}
}
}
/*
example
params "field to check","value",field to format,"before tag","after tag","Html table id(this stays the same unless you change views","bool is it a lookupfield"
format("VIP","Yes","Phone Number","","","{BEEFD7E9- HTML TABLE ID(use view source to retrieve)-F03FDA1BA528}",false);
this will format the phone number as bold for all people who have the VIP field set to yes
*/
</script>

The script relies on the fact that the list view web part always outputs its html table in the same predictable format. You may need to make some changes to suit your application

Friday, April 20, 2007

A Recycle Bin For Sharepoint 2003 Part 1

If you have seen the solution posted by microsoft here http://msdn.microsoft.com/msdnmag/issues/05/02/RecycleBinforWSS/default.aspx you may have been scared by the potential storage issue associtated with having a mirror document library. Over the next few days i will post how we implemented a recylce bin on wss

Thursday, April 19, 2007

Filter a data view by current username rather then display name

version info: Sharepoint 2003 and Frontpage 2003

I ran into a situation where a site owner wanted to restrict the items a user could see based on the current username. I am aware that using the standard data view you can filter by current user but this only works on display name which doesn't help if you have two users with the same name. So we added a username column which held 'DOMAIN\User' to identify which list items where allocated to a particular user.

Next you have to go into the web part properties for the list data view and edit the Parameter Bindings
find the line
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>

modify this line to:

<ParameterBinding Name="UserID" Location="ServerVariable(AUTH_USER)" DefaultValue="CurrentUserName"/>



now UserID will hold the value 'DOMAIN\User' rather then 'Display Name'

Now go into the data view properties select 'Filter' add a filter where Field: Username equals [Current User]
There you have it. A List filtering on a unique domain user name rather then display name

Sunday, April 15, 2007

Which Version?

Ever Had the experience when you find an article and it seems to cover exactly what your looking for and you search the page up and down for some version info but can't find anything which details which version of the product the post is about. No. Must be just me. Anyway just to clear things up I will be mostly blogging about SharePoint 2003

Although I have been attending some training for 2007 and am very excited about the new product most of my ramblings will be concerning 2003 at least until my employer makes the migration(Hopefully soon). I will try to clearly state what product a post is relevant too.

Saturday, April 14, 2007

Why Start Blogging?

Today i decided that I would start a blog about my SharePoint experiences. Why? Even though I have never blogged anywhere about anything I have read hundreds of blogs and forums on SharePoint material and find it quite helpful. At the same time there are often problems I run into which I cannot find documented anywhere. So I decided that I should give a little back and not let my limited knowledge go to waste but share it in the hope that I might be able to help a fellow sharepointopian