Monday, November 26, 2012

Display Sublevel menus for Global Navigation in Sharepoint 2010

To display the Sub level menus as one shown below
 
Follow these below steps.

Open the site in Sharepoint Designer 2010

  1. Open your Master page for the portal say "v4.master" or "v4_Custom.master" (in case you have a custom master page created for your site)
  2. Find for the keyword "Orientation" 
  3.  
  4. Edit the values for "StaticDisplayLevels" and "MaximumDynamicDisplayLevels" as per your requirement. Initial value for "MaximumDynamicDisplayLevels" would be 1 and you can change it to 2 for the menu to appear as  shown in the above image

Wednesday, November 21, 2012

Display BreadCrumbs for Sharepoint 2010 sites


If you want the breadcrumb to appear in proper way, that shows the root site followed by subsite and so on, you can add the below line of codes in your master pagewhich the site is referring to.

    <asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server">
                                            <asp:sitemappath runat="server" sitemapproviders="SPSiteMapProvider,SPXmlContentMapProvider" rendercurrentnodeaslink="true" nodestyle-cssclass="breadcrumbNode" currentnodestyle-cssclass="breadcrumbCurrentNode" rootnodestyle-cssclass="breadcrumbRootNode" hideinteriorrootnodes="true">
</asp:sitemappath>                                   
                                            </asp:ContentPlaceHolder>

Sunday, August 26, 2012

SharePoint 2010: Show QuickLaunch in web part page.

  1.   Remove this place holder from webpart page

< asp:Content ContentPlaceHolderId="PlaceHolderNavSpacer" runat="server"></asp:Content>
< asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"></asp:Content>


2 Remove below code from web part page


<SharePoint:UIVersionedContent ID="WebPartPageHideQLStyles" UIVersion="4" runat="server">
<ContentTemplate>
<style type="text/css">
body #s4-leftpanel {
display:none;
}
.s4-ca {
margin-left:0px;
}
</style>
</ContentTemplate>
</SharePoint:UIVersionedContent>

Tuesday, February 21, 2012

Programmatically applying themes


//Open site collection object
using (SPSite mySite = new SPSite("http://SiteUrl"))
{

// Open site
using (SPWeb oWeb= mySite .OpenWeb())
{
oWeb.ApplyTheme("<theme to be applied>");
oWeb.Update();
}
}

Sunday, February 5, 2012

Programmtically list all attachements in a List

public void fnListAttachments(string site, string listName)
{
    StringBuilder strAttachNames= new StringBuilder();
    using (SPSite oSite = new SPSite(site))
    {
        using (SPWeb oWeb = oSite.OpenWeb())
        {
            SPList oList = oWeb.Lists[listName];

            SPListItemCollection oListItems = oList.Items;
            foreach (SPListItem item in oListItems)
            {
                SPAttachmentCollection attachmentscol= item.Attachments;

                if (attachmentscol.Count <= 0) return string.Empty;

                foreach (var attachment in attachmentscol)
                {
                    strAttachNames.Append(attachment.ToString());
                }
            }
        }
    }
    //return strAttachNames.ToString();
}

Feature handler to save documents to physical folder

  SPSite site = new SPSite(properties.SiteId);
        using (SPWeb web = site .OpenWeb()) {

            string folderName = "";
            SPFolder cols = web.Folders[site.Url + "/TestDocumentLib"];

            SPList list = web.Lists["TestDocumentLib"];
            SPDocumentLibrary docLibrary = (SPDocumentLibrary)list;
            SPListItem listItem = docLibrary.GetItemById(properties.ListItemId);

            SPFile file1 = web.GetFile(listItem.UniqueId);
            string strUrl = file1.ServerRelativeUrl.ToString();
            string destinationFolderUrl = @"C:\Documents and Settings\Documents\";
            byte[] binfile = file1.OpenBinary();
            string strRootUrl = list.RootFolder.ServerRelativeUrl.ToString();


            int count = strUrl.Split('/').Length - 1;
            string[] str = strUrl.Split('/');

            for (int i = 1; i < count; i++)
            {
                destinationFolderUrl += str[i] + "\\" + folderName;
            }
            SPSecurity.RunWithElevatedPrivileges(delegate()
           {
               if (!(Directory.Exists(destinationFolderUrl)))
               {

                   Directory.CreateDirectory(destinationFolderUrl);

                   FileStream fstream = System.IO.File.Create(destinationFolderUrl + "\\" + file1.Name);
                   fstream.Write(binfile, 0, binfile.Length);
                   fstream.Close();
               }
               else
               {
                   //Directory.CreateDirectory(destinationFolderUrl);
                   FileStream fstream = System.IO.File.Create(destinationFolderUrl + "\\" + file1.Name);
                   fstream.Write(binfile, 0, binfile.Length);
                   fstream.Close();
               }

           });
        }
}

Wednesday, January 11, 2012

List Template IDs

List template nameListTemplateID
NoListTemplate0
GenericList100
DocumentLibrary101
Survey102
Links103
Announcements104
Contacts105
Events106
Tasks107
DiscussionBoard108
PictureLibrary109
DataSources110
WebTemplateCatalog111
UserInformation112
WebPartCatalog113
ListTemplateCatalog114
XMLForm115
MasterPageCatalog116
NoCodeWorkflows117
WorkflowProcess118
WebPageLibrary119
CustomGrid120
SolutionCatalog121
NoCodePublic122
ThemeCatalog123
DataConnectionLibrary130
WorkflowHistory140
GanttTasks150
Meetings200
Agenda201
MeetingUser202
Decision204
MeetingObjective207
TextBox210
ThingsToBring211
HomePageLibrary212
Posts301
Comments302
Categories303
Facility402
Whereabouts403
CallTrack404
Circulation405
Timecard420
Holidays421
IMEDic499
ExternalList600
IssueTracking1100
AdminTasks1200
HealthRules1220
HealthReports1221
InvalidType-1

Tuesday, May 10, 2011

Updating values to People & Group field in Sharepoint list

string strAccountName = string.Empty;
                                for (int i = 0; i < userPicker.ResolvedEntities.Count; i++)
                                {
                                    PickerEntity objEntity = (PickerEntity)userPicker.ResolvedEntities[i];
                                    SPUserInfo objInfo = new SPUserInfo();

                                    objInfo.LoginName = objEntity.Key;
                                    strAccountName = objInfo.LoginName;
                                  
                                    if (objEntity.EntityData["SPUserID"] != null)
                                    {
                                        // to return a sharepoint people group formatted string use...
                                        strAccountName = objEntity.EntityData["SPUserID"].ToString() + ";#" + objEntity.DisplayText.ToString();
                                    }
                                    if (objEntity.EntityData["SPGroupID"] != null)
                                    {
                                        // to return a sharepoint people group formatted string use...
                                        strAccountName = objEntity.EntityData["SPGroupID"].ToString() + ";#" + objEntity.DisplayText.ToString();
                                    }
                                }


    item["ColumnName"] = strAccountName;

Thursday, January 20, 2011

Copying Multiple Files to SharePoint Document Libraries

There are several ways to do this, however, if your library has any required fields or 'check in' requirements, there will likely be some preparation steps you need to take. These might include temporarily removing these requirements or options. If you don't, the copying will work, but the files may be stuck in a 'checked out' status until you either check in the files or supply the required metadata.

Solution 1 - Using the "Windows Explorer" option in SharePoint

In the "Actions" menu of any Document Library there is an option called "Open with Windows Explorer". When you select this option, a new window opens. You can literally drag and drop files to and from this window.
Note: You will see a special folder called "Forms" in this window. Do not disturb this folder or use it unless you are specifically working with SharePoint form templates. That subject is outside the parameters of this article.


Solution 2 - Create a permanently mapped folder

In order to make it easier to administer your SharePoint environment, you may want to create a permanently mapped folder, to access SharePoint documents.
Below are instructions for creating this mapping in a Windows 7 environment. (Windows XP instructions later.)
Open Windows Explorer and right click on the "Computer" object. Then select "Add a network location.

This will start the Wizard.
Click "Next" on the "Welcome to the Add Network Location Wizard".

Highlight "Choose a custom network location" and click "Next".

Type the web address of the base URL of your site collection. Then click "Next".

Type a friendly name for the object. You can leave the default or enter something new.

Click "Finish". If you leave the "Open this network location when I click Finish" checkbox checked, the location will open.

In either case, you will have a new object listed under the "Computer" icon, forever available to you.



In Windows XP, there is a similar Wizard in My Network Places. Below is a summary of the steps.
  • Start "Add Network Place"
  • Click "Next"
  • Select "Choose another network location" and click "Next".
  • Enter the URL of the target site collection (i.e. http://portal).
  • Give the object a friendly name (the default is fine or you can create one).
  • Click "Finish".

Solution 3 - Using SharePoint Designer

Using SharePoint Designer 2007, you can also copy files to and from the application interface. Source and destination objects can be:
  • SharePoint Designer to Windows Explorer
  • Windows Explorer to SharePoint Designer
  • SharePoint Designer to SharePoint Designer.

Thursday, January 13, 2011

Create a Custom NewForm.aspx for a SharePoint List

SharePoint has a number of features when it comes to working with its built-in lists. One of these is that it automatically generates New (NewForm.aspx), Edit (EditForm.aspx) and Display (DispForm.aspx) for each list when it is created. While this is very useful, it is somewhat limited when you want to customize what is displayed, or how information is displayed on these pages.
The answer to this problem is SharePoint Designer. In the following scenario, I will show you how to customize the NewForm.aspx page for a SharePoint List using SharePoint Designer.
Your company wants to set up a Computer Equipment Request List to handle new requests that the employees have for the IT Department. So, you go and create the list in SharePoint. All is great until you realize that the majority of the information in the list is for internal IT use, and should not be presented to the end-user to fill out.

All you really want the end-user to complete is the fields, Request Name, Description, and Requested Equipment.
This is where SharePoint Designer comes to the rescue. By completing these steps, you will be customizing your own NewForm.aspx in no time.
  1. Open SharePoint Designer.
  2. Open the Site where your list resides.
  3. In the Folder List window select the Computer Equipment Request list.
  4. Right-click on the NewForm.aspx and select New From Existing Page. This creates a new page based on the original NewForm page. It is a bad idea to modify the default NewForm page, for if you need to revert back to the original, which could prove to be a difficult task. In some cases, this may require re-creating the list.
  5. Now, in the main editor window, select the List placeholder and click on the (arrow) that appears in the upper-right corner. This will bring up the Common Content Tasks List, and then select Default to Master's Content.

    Click Yes on the message box that appears.
  6. Then, you will want to select the PlaceHolderMain(Master) Content Place Holder, click on the that appears in the upper-right corner and select Create Custom Content.
  7. Next, click inside the PlaceHolderMain(Custom) and make sure that you can see the cursor inside the selected area.
  8. After this, in the SharePoint Designer File Menu, select Insert -> SharePoint Controls -> Custom List Form.
  9. In the pop-up box that appears, select the Computer Equipment Request list, and make sure that Item is selected for "Content type to use for form". You'll also want to make sure that New item form is the selected option. As for the Show standard toolbar checkbox, this depends on how you will be using your custom List Form, but for this example, uncheck this checkbox.
  10. After this, in the main edit window, you will now see a custom list form control that can be customized as needed.
  11. For our custom New Form, we need to remove the extra fields that we do not want the end-users to fill out (or see). To do this, select somewhere in the field row that you want to remove (in this case, the Status field). Then right-click and select Delete -> Delete Rows. This will then remove that field row from the custom list form control. Repeat this step for all the fields you want to remove.
  12. Once we have removed all fields we don't want to be displayed, we are left with Request Name, Description, and Requested Equipment.
  13. Now that we have our custom NewForm looking how we want it to, we need to save it in SharePoint so that we can use it. To do this, click on the Save button, and then navigate to the Computer Equipment Request list and look for the original NewForm.aspx page. For this example, we are naming the page SubmitForm.aspx.
  14. Finally, we will want to set our custom NewForm (SubmitForm.aspx) as the default New item form for our list. To do this, go back to the Folder List window select the Computer Equipment Request list and right-click on it. From the menu that appears, select the Properties option.
  15. In the pop-up box, make sure that Item is selected for "Content type specific forms". Then click on the Browse button for the New item form to select our custom SubmitForm.aspx.

  16. Now your custom NewForm page is ready for use. This is how it will appear to the end-user when they create a new item for the Computer Equipment Request list.
By following the above instructions, you will be creating your own customized NewForm.aspx pages in no time using SharePoint Designer. The same techniques can also be applied to creating custom EditForm.aspx and DispForm.aspx pages.
Next time, I'll show you how to apply these concepts to creating multiple custom EditForm.aspx pages to use with different user roles.

Wednesday, January 12, 2011

Programmatically adding SPuser to SPgroup

try
{
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite spSiteTemp = new SPSite(SPContext.Current.Web.Url))
  using (SPWeb spWebTemp = spSiteTemp.OpenWeb())
  {
    spWebTemp.AllowUnsafeUpdates = true;

   SPGroup spGroup = spWebTemp.SiteGroups["MySPGroup"];

        SPUser spUser = spWebTemp.EnsureUser
("DomainName\" + msUser.UserName); 
 
//Adding group  to check SPUser's existing group. 
ArrayList arrayListGroups = new ArrayList();
      foreach (SPGroup tempGroup in spUser.Groups)
      {
        arrayListGroups.Add(tempGroup.Name.ToLower());
      }

       if ((spUser.Groups.Count < 1) 
        || ((spUser.Groups.Count > 1) 
        && (!arrayListGroups.Contains("myspgroup"))))
       {
         spGroup.AddUser(spUser);
       }

          spWebTemp.AllowUnsafeUpdates = false;
        }
    });
}
catch (SPException)
{
     throw;
}

Tuesday, December 14, 2010

Various ways to Deploy SharePoint WebParts

 There are several ways to deploy Webparts

Method 1 - manual
  • Copy assembly DLL to either
    - /bin directory for a given IIS virtual server (e.g., c:\inetpub\wwwroot\bin)
    - Global Assembly Cache (e.g., c:\windows\assembly)
  • Copy DWP file to C:\Inetpub\wwwroot\wpcatalog
  • Copy resources to
    - For GAC-registered parts, C:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources
    - For Web Parts in the /bin directory, C:\Inetpub\wwwroot\wpresources
  • Adjust web.config
    - Register as SafeControl
    - Select Code Access Security settings

Method 2: CAB File
  • CAB file should contain
    -Assembly DLL
    -DWP file(s)
    -Manifest.XML
    -Resource files (if needed)
  • CAB won't contain
    - Code Access Security settings
  • Server-side object model has methods for deploying such a CAB file
  • Deploy with STSADM.EXE
    Located in C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\BIN
    Add it to your path
    Stsadm -o addwppack -filename filename [-globalinstall] [-force]

Method 3: MSI File via WPPackager
  • All of the features of CAB file deployment, but with
    - Code Access Security support
    - Ability to uninstall via Control Panel
  • Get WPPackager.exe
  • Add additional files to project for use by WPPackager
  • Run WPPackager after project is built

Sharepoint Tips & Tricks

1. Deleting error occurred webparts in the portal

  If an error occurs like “An unexpected error has occurred.” and unable to open the design page and the aspx page in the site then follow the below step.


This can be done by adding “?contents=1” to default.aspx page.
 ex: http://myportal/default.aspx?contents=1


2. Adding Quick Launch to Custom webpart Pages


   To  display quick launch bar in Custom web part pages, all you need to do is simply remove couple of lines in the web part page by opening the page in the Designer.

<asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server"></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderNavSpacer" runat="server"></asp:Content>


Wednesday, December 1, 2010

Configuring host header for site in IIS 7.0

 

You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.

User Interface

To use the UI
  1. Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
  2. In the Connections pane, expand the Sites node in the tree, and then select the site for which you want to configure a host header.
  3. In the Actions pane, click Bindings.
  4. In the Site Bindings dialog box, select the binding for which you want to add a host header and then click Edit or click Add to add a new binding with a host header.
  5. In the Host name box, type a host header for the site, such as www.contoso.com.
  6. Click OK.
  7. To add an additional host header, create a new binding with the same IP address and port, and the new host header. Repeat for each host header that you want to use this IP address and port.

Command Line

To add a host header to a Web site's binding, use the following syntax:
appcmd set site /site.name: string /bindings.[protocol=' string ',bindingInformation=' string '].bindingInformation: string
The variable site.name string is name of the site to which you want to add a host header. The variable [protocol='string',bindingInformation='string'] is the existing binding to which you want to add a host header, and bindingInformation string is the new binding with host header.
For example, to configure a site named contoso with an existing HTTPS binding for all IP addresses, on port 443, without a host header to have a host header named marketing, type the following at the command prompt, and then press ENTER:
appcmd set site /site.name: contoso /bindings.[protocol='https',bindingInformation='*:443:'].bindingInformation:*:443: marketing
For more information about Appcmd.exe, see Appcmd.exe (IIS 7).

Configuration

The procedure in this topic affects the following configuration elements:
<bindings> under <site> element

Sunday, November 14, 2010

Writing Server-side ( C# ) code in SharePoint custom pages

There are basically two approaches to write server side code:
A) Inline coding ( C# and HTML code in same ASPX page)
B) Code-Behind (C# and HTML code in seperate files)

A) Inline coding

1) In this approach, first you have to modify application's web.cofig file.
Locate PageParserPaths node in config file and then change it as per your requirement.

If you doesn't know page(s) name which is(are) using server side code, then write /* in VirtualParth attribute,
else write page name as /pagename.aspx in VirtualParth attribute.
[For each page add a seperate PageParserPath node,
for example you want to allow server side code in 5 pages then you have to add PageParserPath nodes.]




<PageParserPaths>
        <PageParserPaths>
        <PageParserPath VirtualPath="/Custom Webpart Pages/*" CompilationMode="Always"   AllowServerSideScript="true" />
      </PageParserPaths>
</PageParserPaths>




2) Write server side code as


<script runat="server">

protected void Page_Load(Object sender, EventArgs e)
{
    Response.Write("Server code in Sharepoint");
}

</script>

The above script
I placed  inside the PlaceHolderMain place holder.

B) Code-Behind approach

1) Create a C# file (or VB file) for your server code


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyNameSPace
{
    public class MyClass : Microsoft.SharePoint.WebControls.LayoutsPageBase
    {
        //Server control declarations
        protected Label lblMessage;

        protected void Page_Load(Object sender, EventArgs e)
        {
            lblMessage.Text = "Server Code";
        }
    }
}



Points to remember:
- Inherits the class with LayoutsPageBase (there are other options also available for choosing base class)
- Declare ASP.Net server control with protected modifier.



2) Register the DLL (that contains above class) in GAC.

3) safecontrol entry in application's web.config file.

4) Create ASPX file for HTML code


<%@ Assembly Name="MyNameSPace, Version=1.0.0.0, Culture=neutral, 
       PublicKeyToken=bf118dafb4e11f4b" %>
<%@ Page Language="C#" MasterPageFile="~masterurl/default.master" 
       Inherits="MyNameSPace.MyClass" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <asp:Label runat="server" ID="lblMessage" ForeColor="Red" 
        Visible="false"></asp:Label>
</asp:Content>


Merits & Demerits

Inline coding
-
In case of any change(s) in code (HTML + C#), replace the existing ASPX file with modified one in SharePoint Designer.
- It is unsafe, to allow server side code by modifying PageParserPaths node in web.cofig
- Can't debug the page [Major disadvantage while development].
-
Easy to deploy, no need to do DLL registration in GAC, IISRESET and safecontrol entry in web.config


Code-Behind
- Can debug server side code ( Debug -> Attach to Process -> w3wp.exe process )
- Need to do DLL registration in GAC, IISRESET and safecontrol entry in web.config
-  In case of any change(s) in HTML code, replace the existing ASPX file with modified one in SharePoint Designer.
- In case of any change(s) in server-side ( C# ) code, re-register the DLL in GAC (drag-n-drop dll in assembly folder) and do IISRESET [ Must ] to see the change(s).

Login pop-up in SharePoint

If you gets login pop-up whenever you opens any SharePoint page in Internet Explorer (IE), then solve this issue we need to change following IE settings...Add the SharePoint site to the list of Local Intranet (IE7/8).
1) In Internet Explorer, on the Tools menu, click Internet Options. 
2) On the Security tab, in the Select a Web content zone to specify its security settings box, click Local Intranet, and then click Sites. 
3) Clear the Require server verification (https:) for all sites in this zone check box. 
4) In the Add this Web site to the zone box, type the URL to your site, and then click Add. 
5) Click Close to close the Local Intranet dialog box. 
6) Click OK to close the Internet Options dialog box. 

Code to download document from SharePoint Document Library

string siteURL = "http://mysite:80/"; //Write valid site URL 
//Get SPSite and SPWeb instance
using (SPSite spSite = new SPSite(sireURL))
{
 using (SPWeb spWeb = spSite.OpenWeb())
 {
        //Get time stamp to download file with unique name
     string strFileName = DateTime.Now.ToString("ddMMyyyy_HHmmss");

        //Get folder path
     string directoryPath = 
       Path.Combine(Environment.GetFolderPath
                          (Environment.SpecialFolder.LocalApplicationData),
                        "MyFolder");

        //Create directory if it not exist
        if (!(Directory.Exists(directoryPath)))
        {
            Directory.CreateDirectory(directoryPath);
        }

        //Get template url
        string documentUrl; //Write valid document URL

        //Download file in file system
        SPFile myFile = spWeb.GetFile(documentUrl);
        byte[] binFile = myFile.OpenBinary();

        //Generate file name
        filename = Path.Combine(directoryPath, strFileName + ".doc");

        //Do file write operation
    FileStream fs = 
     new FileStream(filename, FileMode.Create, FileAccess.ReadWrite);
        BinaryWriter bw = new BinaryWriter(fs);
        bw.Write(binFile);
        bw.Close();
    }
}

Saturday, November 13, 2010

Configure SharePoint Forms Based Authentication to use LDAP

Problem

This article outlines how to configure SharePoint Forms Based Authentication (FBA) to use Lightweight Directory Access Protocol (LDAP), typically used on a SharePoint Extranet.

Solution

Prepare the Authentication Provider

First we need to configure the Authentication Provider to use Forms Based Authentication. This is done via SharePoint Central Administration.

  1. Browse to SharePoint Central Administration
  2. Select the Application Management tab
  3. Under the Application Security section select Authentication Providers
  4. Select the appropriate Web Application which you want to allow FBA for.
  5. Click the appropriate Zone you would like to change, only Default is shown below.
  6. Scroll down to the Authentication Type section and change the Authentication Type to Forms
  7. Scroll down to Membership Provide Name and enter the name of your Membership provider, this must match the name in your web.config (see below).
Note the Enable Anonymous access check box. This is one of two settings you need to change to allow anonymous access to part of your site. You might want to do this to present a custom logon form.

pdate SharePoint Central Admin web.config

Please note that updating the web.config incorrectly can damage your SharePoint installation. Extreme care should be taken, please do not edit the web.config if you are not familiar with web.config or XML structures.

  1. Make a backup of the web.config file (always a best practice).
  2. Locate your web.config file for the SharePoint Central Administration website. Normally located in C:\Inetpub\wwwroot\wss\VirtualDirectories
  3. Take special care to select the right Virtual Directory, mine is named SharePointCA80 yours will be different
  4. Locate the web.config file and open it with notepad
  5. Scroll down to the configuration node, find





  6. Replace the ??? with your domain name
  7. Scroll down to the system web node and the following membership







  8. Replace the connectionstring to the one matching your environment and replace "xxx" with domainname\username and "yyy" with password
  9. Save and close the web.config for SharePoint Central Administration
  10. Update the web.config of SharePoint Web application
  11. Repeat steps 1 to 8 for the web.config of the SharePoint web application you configured the Authentication Provider for Forms Based Authentication above
  12. Check the authentication in this web.config is set to the following.




Note you can specify a custom login page here, shown as loginUrl="" above. I strongly recommend you use an LDAP query tool to discover your path before setting up SharePoint.

Sharepoint Calculated columns

Calculated columns – An example

By adding a calculated column to a list or library, you can create a formula that includes data from other columns and performs functions to calculate dates and times, to perform mathematical equations, or to manipulate text. For example, on a tasks list, you can use a column to calculate the number of days it takes to complete each task, based on the Start Date and Date Completed columns.
(Excerpt from the Microsoft Web site)

Let me use this Microsoft example to walk you through the setup of calculated columns.

We first need to create our SharePoint tasks list (Site Actions > Create > Tasks).

It already includes a [Start Date] column, let’s add the [Date Completed] one:
- Select: Settings > Create Column
- Create a column called “Date Completed”, with type set as ”Date and Time”.
- Click OK

  • We are now ready to create our first calculated column:
    - Select: Settings > Create Column
    - Create a column called “Duration”, with type set as ”Calculated (calculation based on other columns)”
    - Enter the formula:
    = [Date Completed]-[Start Date]
  • - Click OK

Let’s take a look at the result:

As you can see, the result is incorrect when the [Date Completed] field is empty. To fix this, we’ll add a condition to our formula:
=IF([Date Completed]=0,”",[Date Completed]-[Start Date])

Now, the duration will only be displayed after the user enters a value for “Date Completed”:

Add Web Parts to DispForm, EditForm or NewForm.aspx

When I browsed to the “View Item” page and clicked the “Site Actions” I noticed that there wasn’t an “Edit Page” option available. Strange, but after some -Googling- I found the following sollution:
  • Open IExplorer and navigate to your “View Item” page (DispForm.aspx)
  • Replace everything in the URL after “?ID=#“ with “&PageView=Shared&ToolPaneView=2″ (without the quotes of course) and press
After adding a Web Part to the page and saving it, the “Edit Page” option will be available the next time you click “Site Actions” on that Page.

A sales engineer is someone who promise you a bridge, even when there's no river.