Author Archive

Date Range filtering with the new version of FilterPoint, PivotPoint and Planner.

Date:December 13th, 2011 Author: Tags: , , , ,
Category: Calculated Columns, Filter, FilterPoint Web Part, PivotPoint Web Part, SharePoint Planner, SharePoint webparts Comments:0 ;

FilterPoint has had the ability to send Date Filters but a common request has been Date Ranges – like showing everything this month, last year or between two arbitrary dates.

FilterPoint - Date Range Filtering

The good news is that we’ve added this in to FilterPoint as of version 1.2

The bad news is that this will only work with our other SharePoint products – Planner and PivotPoint – it won’t work with SharePoints built in List View web part (LVWP).

That’s disappointing!

Yes it is – it’s just a limitation of SharePoints filtering I am afraid, but all is not lost!

This page shows how you can do things like Month filtering using calculated columns and this blog article shows how you can setup “Current Month/Previous Month” views using nothing more than Calculated Columns and View filters.

Upgrading

As always you can upgrade without losing any settings by downloading and running the latest trial version and selecting “Upgrade” when prompted (don’t forget you need the a recent version of Planner (v2.6.9+) and PivotPoint (2.2.0+) to accept date range filters.

Word wrapping SharePoint list column headers

Date:June 23rd, 2011 Author: Category: General Comments:10 ;

A customer for our Highlighter product recently asked us how you could modify SharePoints List View Web Part (LVWP) to word wrap column headers. He had found that as he had replaced lengthy text with status icons he could fit a lot more columns on the page – if only he could shrink the column headers down.

To be clear – this isn’t unique to lists using our Highlighter product, this example shows a basic SharePoint list with a long title that is causing a horizontal toolbar as it won’t word warp even though the column will only ever contain Yes or No.

Of course you could rename the column and shorted the name and put more information in the description – but that only appears on the Edit form so it’s a balancing act between being brief and giving enough info so everyone knows what the columns contains.

Anyway – how to make these columns word wrap?

Inspired by this post on Stack Exchange I looked at using Cascading Style Sheets to do this.

The property we need is white-space : normal

Then we need to figure out which parts of the html to apply it to. This is done by HTML classes, so taking into account SharePoint 2007 and 2010 and different column styles (number/text/filterable/non-filterable) we end up with.

<style type= "text/css">
.ms-vh, .ms-vh2-nograd, .ms-vh2, .ms-vb
{white-space: normal}
</style>

So the white-space property is applied to html elements with a class of .ms-vh, ms-vh2-nograd and so on.

We could also make the column headers center aligned and red (just for an example) by putting in

<style type="text/css">
.ms-vh, .ms-vh2-nograd, .ms-vh2, .ms-vb
{white-space: normal;
text-align:center; 
vertical-align:text-bottom;}
</style>

So how do we add these styles to the page?

You can use SharePoint Designer, but perhaps the easiest way is to add it via a Content Editor Web Part (CEWP)

  • Go to your list.
  • Select Site Actions > Edit Page
  • Click “Add a web part”
SharePoint 2007 SharePoint 2010
  • Select Miscellaneous > Content Editor Web Part
  • Click “open tool pane” then “Source Editor”
  • Add in the CSS from above
  • Select Media and Content > Content Editor
  • Select “Click here to add new content”
  • On the ribbon select Html > Edit HTML Source
  • Add in the CSS.

And – word wrapping :-

If this doesn’t work for you then as with all things ‘code’ exact syntax is important so check everything carefully – a “ is not the same as a ” for example. Also be sure that you’ve put the CSS in the HTML Source area, not just directly into the rich text editor.

You can add lots more effects (Red, bold etc) but sometimes its hard figuring out exactly what html elements and classes to target (e.g. you can’t apply a colour to the .ms-vh table header, you’ve got to apply it to an anchor element inside this – so “.ms-vh a”) – Firebug, the IE developer tools or the Chrome equivalent are invaluable for this – they will save your sanity!

ViewRescue for SharePoint 2010 – Updated!

Date:March 30th, 2011 Author: Tags: , , ,
Category: General, SharePoint Free Tools, SharePoint webparts Comments:0 ;

View Rescue

We’ve recently updated our free ViewRescue tool for SharePoint 2010 to version 1.1.2

This latest version will now work with customized Master Page templates, as long as you have an “AdditionalPageHead” control in your template.

See our website for the latest version (you can install this over the top of the existing version to upgrade) and details about this free tool  that fixes a common annoyance in SharePoint 2010.

SharePoint 2010 and the mystery of the disappearing view selector menu

Date:March 8th, 2011 Author: Tags: , ,
Category: General, SharePoint webparts Comments:17 ;

Remember the good old days, before SharePoint 2010, when a dropdown on the top right of a List View Web Part (LVWP) allowed you to select different views, quicly and easily?

In SharePoint 2010 we have lost this handy feature.  On some pages, a substitute does exist in the Breadcrumb on the title bar (which is part of the Ribbon, at the top of the page). It took us a little while to actually realize was there – but once we found it, it was very welcome.

SharePoint List View Selector Menu

But wait, all is not well. as Kerri from one of our partners – LookOut Software who develop CRM software for SharePoint – pointed out even the breadcrumb option disappears on the majority of pages. It disappears if you

  • Add another list view web part
  • Add any other web part such as a Content Editor Web Part containing things like instructions for the list
  • 3rd party web parts like our PivotPoint or FilterPoint tools that work really well alongside list views for creating dynamic dashboards.
  • use your list on a wiki page – and remember most of the pages in SharePoint 2010 are wiki pages by default now.

Also you don’t get it if you’ve created a new page and added a list view web part to it.

Once it’s gone, you have to resort to the following ninja moves to change a view. Select the list title (or something in the list) > List Tools > List, Current View dropdown > Then the view you want. 4 clicks? My finger is getting sore SharePoint!

This bugged me so much that I decided to look into it further and ended up developing a little tool which  - well – rescues the view selector drop down.

If you just want the solution you can skip the rest of this post and download our free fix for this annoyance – ViewRescue

View Rescue for SharePoint 2010

If you’re interested in the techie details then read on…

Reminder Web Part updated – support for Host-named site collections

Date:January 26th, 2011 Author: Tags: , ,
Category: SharePoint Reminder Comments:0 ;

Our Reminder Web Part – which adds advanced email alerting features to SharePoint – has recently been updated.

The main new feature in version 1.7.9 is support for host-named site collections (aka host header based site collections).

A host header is the main part of a url – such as www.pentalogic.net or sharepoint.yourcompany.com

Normally SharePoint uses separate Web Applications for different host headers and whilst you can use Alternate Access Mappings (AAM) to map two different urls to the same site (e.g. sharepoint for internal access  and http://sharepoint.yourcompany.com for external access to the same site) you can’t have entirely different sites served by the same web application on different urls.

Why does this matter to you?

Well, for the vast majority of you it doesn’t! In fact you can’t create host header site collections using SharePoints Central admin tool – you’ve got to break out the command line STSADM or powershell.

For most installations you’re likely to have a scheme such as sharepoint.yourcomapny.com/sites/HR and sharepoint.yourcomapny.com/sites/Finance etc  and you may perhaps use Alternate Access Mappings (AAM) to give alternate urls for the same content. e.g. a shortcut of sharepoint/sites/HR and sharepoint/sites/Finance.

However, you can’t use AAM to serve different content from different host headers using the web application. So if you want to have customer specific sites such as CustomerA.yourcompany.com and CustomerB.yourcomany.com (a very common requirement for hosting companies) then you have to create separate web applications for each host header.

The problem is that this doesn’t scale very well above approximately 20 web applications and instead you’re advised to use host header site collections.

In addition we’ve also included corrections to errors caused by mixing field names and formatting in the Rich Text Editor and separating multiple email addresses in rich text fields with new line characters were also included in this new version.

You can download the latest version and update without loosing any settings – upgrade instructions are included in the manual.

SharePoint and Visual Studio 2010 – Adding ClassResources to a Web Part

Date:September 20th, 2010 Author: Tags: , ,
Category: SharePoint Development Comments:3 ;

I’ve been working on moving all our products over to Visual Studio 2010. Whilst Microsoft still has some way to go to make SharePoint totally developer friendly (I mean 47 1/2 steps to install SharePoint 2010 on a Windows 7 desktop for development? And shake a double 6 to start? Really?) they have made huge advances and the SharePoint tools built into Visual Studio 2010 are a big improvement on hand crafting or using VSeWSS or WSPBuilder.

I’ve learnt a few things along the way and thought I would pass them on. Today its :-

How to add ClassResources to a Web Part

ClassResources are intended to be used for browser requested resources used in a web part – e.g. images, css files and javascript. This location is often forgotten about and instead these types of files end up spread all over the place.

(more…)

Using [Today] in SharePoint calculated default values

Date:September 2nd, 2010 Author: Tags: , , ,
Category: Calculated Columns Comments:10 ;

Despite the infamous “fake today column trick” still appearing in new blog posts on a monthly basis you can’t use Today in calculated columns in SharePoint.


I’ve seen people assume (not unreasonably) that the same rule must apply with calculated default values used in columns that are not calculated columns as well – but strangely,  you actually can use Today in calculated default values, so I am going to explain why it works and how you might use this.

What is the difference between Calculated Column and Calculated Default value?

A calculated column, erm… calculates values from other columns in your list.

SharePoint - add Calculated Column field

For example if you have an orders list with a Quantity and Price column you can calculate a Grand Total of Price * Quantity.

With a calculated default value you use a calculation to set the default value for a column that is not a calculated column – this is the value that is entered automatically when a new list item is created and may be over-written by the user.

SharePoint - setting a calculated default value

So why may I want a calculation using Today as the default value?

Suppose we have a list containing customer complaints and we have a target to resolve everything in 3 days. Sometimes though for complex queries or if there are public holidays we may give more time. In that case we can set the default value as

= Today + 3

But the user can override that if necessary (public holiday etc).

So why can I use Today here but not in calculated columns?

With a calculated column the calculation is only reworked every time a record is updated. When it’s just viewed then it picks up the saved result from the last edit. This makes perfect sense for most calculated values, but not for values using Today or Me.

So for example if we tried to calculate the days left until a due date we might want to use

Days left = Due Date - Today

If we added the complaint on Monday then it would show that we have 3 days left to do it (Thursday). If we just look at the record on the Wednesday it would still show 3 days (as this was the calculation saved on Monday) when in fact we only have 1 day left to keep the customer happy.

That’s why SharePoint wont let you use Today in calculated columns.

However with a default calculated value the result is only worked out once when the record is being created – it’s understood that what is saved in this field is not updated automatically so there is no problem with using Today.

For a bonus point – you can’t reference other fields in calculations for default values (e.g. Start Date or Order Date) as before a record is being created the fields don’t yet contain values.

What else could I do with this?

The OP in this thread is using it to set default financial years. Suppose that your company’s financial year starts in April then you could use this formula to default to 2009/10 or 2010/11 on or after April.

=IF(MONTH(Today)>=4,"2010/11","2009/11")

or generating the year 20xx/xx notation automatically :-

=IF(MONTH(Today)>=4,YEAR(Today) & "/" & (YEAR(Today)+1),(Year(Today)-1) & "/" & YEAR(Today))

It’s also worth noting that you can use a similar formula in calculated columns – suppose you have an Order Date field and the financial year depends upon when the order was placed then simply replace Today with Order Date.

NB – This has been tested with SharePoint 2007/2010.

Free SharePoint Calculated Column Cheat Sheet

a handy 3 page reference for calculated column functions and formulas.

How to edit List forms in SharePoint 2010

Date:July 29th, 2010 Author: Tags: , ,
Category: General, SharePoint Ideas Comments:6 ;

In SharePoint 2007 there is a well known trick for opening up a list’s forms (New/View/Edit) in design mode – append ?ToolpaneView=2 onto the url – this is often used to add instructions or javascript using a Content Editor Web Part (CEWP) e.g.

However when I first tried to use my tried and tested shortcut in SharePoint 2010 I came a little unstuck as now the New/View/Edit forms appear in a fake popup window and modifying the URL doesn’t work.

There are two ways to do this in SharePoint 2010 – and once you know where to find them they should actually make life that little bit easier.

The first is to open up the form in a new window and then add ToolpaneView=2 onto the end of the URL, so

Right click on Add new Item or the lists Title field and select Open in New Tab or hold down CTRL while left clicking.

Alternatively you can do this using the new-fangled ribbon toolbar – select under List Tools the List tab, then on the right hand side of the ribbon you should see an icon for Form Web Parts which gives a menu of the different forms associated with the list that you can edit.


Showing the records ID on the View and Edit forms

Date:July 23rd, 2010 Author: Tags: , ,
Category: SharePoint Ideas Comments:10 ;

SharePoint - Modify View and show ID column

ID’s are a convenient, often short, way to uniquely refer to something. Unless you’re the Tax man who seems to believe he can’t get through his day without giving me, thats just one person, 7 unique id’s – presumably one for each extremity that we would like a piece off…

I digress… ID’s – SharePoint uses an ID for each item in a list and sometimes its handy to know them “Ere Bob – have you done task 1234 yet?”

You can easily add them to the list view (Modify this View then find the ID column, click display)

SharePoint - view with ID column

But what about if you want to see this on the View and Edit forms? (You can’t see it on the New form as it doesn’t get an ID assigned until you’ve created it)

You can’t do this in the UI. You can create a custom View/Edit form using SharePoint designer but its quite complex, is a pain when we add new fields and its fraught with potential problems.

So instead we’re going to look into every ones favourite SharePoint UI hacking tools – the Content Editor Web Part (CEWP) and javascript/jQuery.

(more…)

SharePoint Terminology – Farms, Web Front Ends, Web Application and Sites

Date:July 8th, 2010 Author: Tags: , ,
Category: General, SharePoint Development, SharePoint Ideas, Training Comments:2 ;

There is a great deal of confusion around some terms related to the different levels of SharePoint hierarchy. Some of this is buzword overload and some  has been brought about by inconsistent usage from Microsoft (and to be fair actually most of us in this industry).

So if you’ve ever wondered what things like Farm, WFE, NLB, Web Application, Site Collection and Top Level Site mean I am going to try and clarify the different terms without getting too technical as some of this stuff needs to be know by advanced, or power, users. I’ve missed out some of the more esoteric things like managed paths in the interests of readers sanity.