U2U Blog

for developers and other creative minds

Tool to check Non Empty Behavior

In an OLAP cube, it is important that the cube can quickly figure out if a certain cell (or tuple, for the MDX fans out there) is empty or not. For measures, Analysis Services is keeping track of this. But for calculated members, the system has to evaluate the full expression, which slows down the query. Unless... unless we can tell the system that the calculated member will be empty (null) when another, real member is null. This is done via the non-empty behavior property of the calculated member.

It is common to check all your calculated members to see if this property is set (or there is a valid reason why not setting this property is OK). To help you with this, we develop a tool: NEBChecker. With this tool, you can quickly see all the calculated members in your live cubes which do not have a non-empty behavior set on them. The tool also shows you the definition of the relevant calculated members. Go to the U2U Resource center and give it a try!

UPDATE: NEBChecker doesn't exist anymore: it became part of the SSAS best practise analyser, wich you can download at the u2u resource center as well:



OBA Workshop at World Partner Conference in Denver

Friday evening I flew from Iceland directly to mile high city of Denver. I am delivering a three-day developer-focused workshop teaching participants the different techniques of building business applications on top of the 2007 Microsoft Office platform. Yesterday we covered the options for extending the clients, today is all about the WSS 3.0 solutions platform and tomorrow we'll cover the additional options when you have MOSS up-and-running within your server farm. Three days is of course way to short to deliver this but it is meant to be a jumpstart for further study and exploration. I like to teach this workshop since it is based on the ascend training Ted and I created 2 years ago updated with OBA topics and plenty of new lab material. I will redeliver this training in the UK the week of the 17th of September and probably additional ones in EMEA in the fall. The only unfortunate thing is that I have to teach in the weekend. Tuesday I leave back to Belgium to make sure I can pick up the second part Wednesday afternoon of the U2U advanced SharePoint developer training. I think after that (14 days in a row of teaching), I'll be ready for my vacation in Cyprus. Ah.. sun, sea and ouzo… looking forward to that one!

Shortcuts in Document Libraries

As we all know, a Document Library is a container for storing files (pictures, office files, pdf, ...). You can add a new files using the new button or you can add already existing files by using the upload button.

One of the cool things in Document Libraries is the 'send to' functionality. This functionality makes it for you possible to send a copy to another Document Library and even synchronize it when you change the source item. But if you think about it, a copy of the same document is actually storing the same content twice in the database.

A better idea would be if we could add a link to a document in another library or to a document on a server, like a shortcut on your desktop.

Well, this is something that you again could do with content types, and the cool thing is that we do not even have to create that content type, it already exists.

Okay, start by creating two libraries, I've created the 'My Documents' library and the 'U2U Reports' library:



I want to create a link in the 'My Documents' library to a report in the 'U2U reports' library using the 'New' menu:


To achieve this, we need to enable content types for this library. Go to the Document Library settings and click on advanced settings:


On this page you need to specify that you are going to allow the management of content types:


Once you've done this, you will have a new section on the Document Library settings page. In this section you see that we already have one content type available. That is because when we created the library, we specified that we want to store Office Word documents in it.


Now, as I said, we are not going to create a content type, but we are going to use an already existing one. Click on 'Add from existing site content types'.

This will open up a page where you can add the content types that you want to use. Look for 'Link to a document' and add it using the add button:


Once, you've done this you can go back and test this in your library. Click on the new button and add a link to a document in another library or to a document somewhere on your server:



Again, hope that you can use this on your SharePoint sites.

Username directly shown in InfoPath form

When you create an InfoPath form, which you for example are going to use in a SharePoint site, you want to automatically fill in the name of the user. This is not very in infoPath:

1. Create an InfoPath form and drag a textbox control on the design surface


2. Go to the properties of the textbox, by double or right clicking on it. Once you have the properties dialog box open,you can opt to fill in a default value. We going to use a function to fill in the value.

Click on the button next to the default value textbox and insert a new function.



3. Now search for the userName function, it's the last one if you search in the All category:


Close the properties and open your form, you will see that the name is automatically filled in now.

Folder with comment field

In a document library you have the option to add some folders. Could be for specific reasons: to organize your documents in the library, to set user permissions in 2007.

One of the things that I miss when adding folders to a library is the ability to add some extra information to the folder, for example: you want to have an extra field where you can fill in a description about the items that you store in the folder.

In this walkthrough I'm going to show you how you can use a folder with a comments field. Before I start with this walkthrough, I'm going to explain what 'Content Types' are.

Basically a Content Type in SharePoint is an object which can hold content or information (a Word document, an Excel report, a Picture, a Task, ...). There is a whole list of content types available which you can use in Lists and Document Libraries. You can find an overview of the available Content Types if you go to the settings of your site and click on the 'Site content types' linkbutton in the Galleries section:


If you look carefully, you will see that there is a 'Folder' content type, that is the one that is used in Document Libraries and that is the one we want extend with an extra field. Now, you have 2 options, you could modify the already existing one but that will affect all the folders in every document library on your site, or we can create our own custom content type and that is the option that we are going to pick.

Click on the create button to create a new content type. Once the create page is open, you can start by giving your type a name. I'm going to use 'Folder with comments' as the name of my content type.

The next thing that we need to do is, selecting a parent. For every content type that you create you need to select a parent. Selecting a parent means that we are going to use the already existing functionality of the parent and in our case that will be Folder functionality.

Select Folder as the parent of our content type:


We are not going to put the content type in a new group but we are going to put it with the other Folder Content Types. Select 'Folder Content Types' as the existing group.

Once your Folder is created you will be redirected to a page where you can set some properties for your content type.We are going to add an extra column. The column that we will use is a 'site column', the reason for this is because we will use the content type not for one Document Library but for multiple libraries. You need to create a column which can be used for the whole site.

Again you have 2 options, you can create a new site column or you can look if the column that you want to use already exists in the site columns gallery.

The column that we are going to use is the Comments field. This column is one that already exists in the gallery so the only thing that we need to do is adding it to the columns of the content type. Opt for 'Add from existing site columns'.




Once the column is added we can specify on a library that we want to use content types. This is not done by default so we need to go to the library settings and specify that we want to allow the management of content types in the 'advanced settings' of the library.


Once you've specified yes and clicked OK you will see that you have a new 'content types section' on the settings page of your library:


On the screenshot you see that 'Document' is already listed, that is because it was already available when we created the library. The last thing that we need to do is adding our content type to the available content types for this library. Click on 'Add from existing site content types' and add your type. Because we've put our 'folder with comments' content type in the 'Folder content types' we can easily find in back again.


Click OK and go back to your library, open the New drop down and now you can use the 'Folder with Comments':



That's it, enjoy

Fix the 'problems' in your Site

When you are creating or modifying sites or pages it could be very nice to see some reports. You can use the Site Usage reports but they give you reports on how many times your site has been viewed.

These are not the reports that I mean, I want to see some reports to know if there are some issues on my sites or pages. Again let SharePoint Designer be your friend and let him show you what is going wrong on your site.

Open a site and use the Site menu in the menu bar and navigate to Reports/Problems and pick an option:



In these screenshots I want to see if my links are OK but as you can see you have other options as well, for example what are the slow pages and do I have unlinked files.

A night out with the Vikings

Yesterday evening the guys here in Iceland (yep... the Vikings) took me out for a nice dinner and a couple of beers afterwards. We went to what they refer to as downtown Reykjavik. Reykjavik is actually a nice little city with the traditional Scandinavian type of houses, good restaurants and a couple of nice pubs. Again it was pretty weird to just walk around in the city at 1 AM in the morning in bright daylight. The local beer that is quite popular is appropriately named Viking beer. We drank a couple, not too much since we have a busy day today. I do notice however that 4 of my students are not here anymore in the classroom. That of course could be due to many things J

Using calculated field on Yes/No fields

When you are creating columns in a list you can opt for a calculated field. With this field you can do calculations depending on other fields. You can multiply, add, divide ... fields with each other.

If you have a monthly wage field, you can automatically calculate the yearly wage by multiplying with 12.

You can use a calculated field on a Yes/no (checkbox) as well. For example if the checkbox is checked you can display "checked", otherwise you can display "unchecked". 

This is the formula that you need to use:


That's it for now, hope you can use this one