As you're all waiting for SharePoint 2010, Now is the chance to taste it. Click here to download your SharePoint Server 2010 Beta version now.
Few months ago I wanted to create a custom master page for a SharePoint portal and after some research I found a way of customizing master pages on SharePoint. But I couldn’t post a blog about it. Here I am attaching my custom master pages and I will update this as I develop it further in the future. I will explain the ways of customization soon.
| Intranet for Spring Global Services on MOSS 2007 |
| Intranet for another customer on MOSS 2007 |
| Hosted WSS site on WSS 3.0 |
Few days ago MS has announced Visual Studio 2010. It contain many SharePoint project templates and grate features for SharePoint developers. Here is the short overview which Microsoft SharePoint Team Blog has given. Read more at Microsoft SharePoint Team Blog.
SharePoint Project and Project Item Templates
The following SharePoint specific project templates and project item templates are available in Visual Studio 2010:
Project Templates
· Empty SharePoint project
· Visual Web Part project
· Sequential and State Machine Workflow
· Business Data Connectivity Model
· Event Receiver
· List Definition
· Content Type
· Module Project
· Site Definition
Project Item Templates
· Empty Element
· Web Part
· User Control
· Application Page
· Association Form
· Initiation Form
· Business Data Connectivity Resource Item
· List Instance
· List Definition From Content Type
· Global Resources File
Besides above mentioned project templates, there are two import project templates for importing .WSP file contents and importing reusable workflows:
· Import Reusable Workflow
· Import SharePoint Solution Package
This is a clock web part shows digital clocks depends on the user needs. Thanks to anujpant for sharing this at codeplex. You can find the original source and wsp file here.
The original clock looks like this
Customized clock will looks like this
You can download the customized source code here what I edited for my requirement.
I customized this with VS 2008. Here I wanted to display the city/country name beside the clock rather than displaying under the clock. So I added a new cell into the same row.
Then I wanted to remove clock skins. The original clock can select 4 color skins as the user wants. After deploying the clock I realized that displaying seconds is disturbing the users. It’s worse when you added more than 5 clocks. So without removing the seconds I hid it.
Recently one of our customers wanted a currency converter on their SharePoint site. This can be done developing a custom web part. I developed a web part using VS 2008. So I thought of publishing it with the source then anyone can download and modify it as they want.
Here is what it looks like
You can download the source codes here.
First I want to thank Shalvin for the free currency converter web service. Here he has explained how we can use the web service in SharePoint. Now I am going to explain my web part with some screenshots.
Now open your VS2008 and create a new project using Web Part template.

We start adding the web service to our project. Right click you project in the solution explorer and click on Add Web Reference. Type our web service URL in the URL box and click Go. If you want you can change the Web Reference Name and click Add Reference.
Open your .cs file and define some variables and controls.
CurrencyConvertor.CurrencyConvertor cc = new CurrencyConvertor.CurrencyConvertor();
double dblConv;
double dblAmt;
DropDownList lstEndCurr;
DropDownList lstStartCurr;
Button btnSend;
Label lblConversion;
TextBox txtAmount;
Label lblConvert;
Label lblInto;
Label lblAmount;
Label lblDetails;
Make sure you have “WebControls” namespace in your class
using System.Web.UI.WebControls;
We are going to have two DropDownList controls for “From” and “To” fields. So we need to fill them with currency codes with description. So here I have wrote a function for that which will return a HashTable and you can directly bind that to the DropDownList. Here if you want you can directly call method from the web service and fill the DropDoenList.
private Hashtable setDDL()
{
Hashtable hTable = new Hashtable();
hTable.Add("AFA", "AFA-Afghanistan Afghani");
hTable.Add("ALL", "ALL-Albanian Lek");
hTable.Add("DZD", "DZD-Algerian Dinar");
return hTable;
}
Then we need to add our controls to a collection. So we can call them when we render the page. So here we use enumeration type.
private enum WebPartControls
{
lblAmount,
txtAmount,
lblConvert,
lstStartCurr,
lblInto,
lstEndCurr,
btnSend,
lblConversion,
lblDetails
}
Now you can add code for all your controls to the “CreateChildControls” method. Here I haven’t add all my codes in this post.
protected override void CreateChildControls()
{
//Set properties for Amount label
lblAmount = new Label();
lblAmount.Text = "Amount :";
lblAmount.Width = 60;
this.Controls.Add(lblAmount);
//Set properties for Amount textbox
txtAmount = new TextBox();
txtAmount.Width = 100;
this.Controls.Add(txtAmount);
//Set properties and items for from DropDownList
lstStartCurr = new DropDownList();
//Define a Hashtable and set the return Hashtable from setDDL function
Hashtable hTableStart = new Hashtable();
hTableStart = setDDL();
lstStartCurr = new DropDownList();
lstStartCurr.DataSource = hTableStart;
lstStartCurr.DataTextField = "Value";
lstStartCurr.DataValueField = "Key";
lstStartCurr.DataBind();
this.Controls.Add(lstStartCurr);
//Set properties and event for convert button
btnSend = new Button();
btnSend.Click += new EventHandler(btnSend_Click);
btnSend.Text = "Convert";
btnSend.Width = 75;
this.Controls.Add(btnSend);
ChildControlsCreated = true;
}
Next we can start writing the event for our convert button
void btnSend_Click(object sender, EventArgs e)
{
//Creat two object from the currency web service
CurrencyConvertor.Currency fromCurrency = new CurrencyConvertor.Currency();
CurrencyConvertor.Currency toCurrency = new CurrencyConvertor.Currency();
//Convert selected items from DropDownLists into currency objects
fromCurrency = (CurrencyConvertor.Currency)Enum.Parse(typeof(CurrencyConvertor.Currency),
this.lstStartCurr.SelectedValue.ToString());
toCurrency = (CurrencyConvertor.Currency)Enum.Parse(typeof(CurrencyConvertor.Currency),
this.lstEndCurr.SelectedValue.ToString());
//Pass our from and to currency codes to web service and get the return value to a variable
dblConv = cc.ConversionRate(fromCurrency, toCurrency);
lblConversion = new Label();
dblAmt = Double.Parse(txtAmount.Text.ToString()) * dblConv;
lblConversion.Text = dblAmt.ToString();
this.Controls.Add(lblConversion);
//Set the value for Details label with the return values
lblDetails = new Label();
lblDetails.Text = "1.00 " + lstStartCurr.SelectedValue.ToString() + " = " + dblConv.ToString()
+ " " + lstEndCurr.SelectedValue.ToString();
lblDetails.Style["text-align"] = "center";
this.Controls.Add(lblDetails);
}
Next we can start out render method. This is the method which will create UI in our web part. We can insert html break tags between controls to have space in-between.
protected override void Render(HtmlTextWriter writer)
{
try
{
Controls[(int)WebPartControls.lblAmount].RenderControl(writer);
Controls[(int)WebPartControls.txtAmount].RenderControl(writer);
writer.Write("<BR>");
writer.Write("<BR>");
if (Controls.Count == 9)
{
Controls[(int)WebPartControls.lblDetails].RenderControl(writer);
}
}
catch(Exception ex)
{
}
Now we are done all coding things. Select your project and go to properties. It will open the project property window. Click on Debug and click on Start browser with URL. Type your site URL in the text box.
Now go to Build menu and select Deploy Solution. Visual studio will create our web part and deploy it into the SharePoint site.
Happy coding!
Recently I did a session at ITPro forum about Business Data Catalog with SharePoint 2007. Here I wanted to focus all our techies that how we are able to connect LOB systems to SharePoint 2007 using BDC and no coding solutions with LOB systems on SharePoint 2007.
Below the agenda of my session.
- Introduction to Business Data Catalog
- Why you need BDC?
- Live Demo with Simple BDC Application
Screenshot of simple BDC application
- Live Demo on Configuring Search with BDC Application
Screenshot of search results
- Live Demo on Configuring InfoPath from with BDC Application
Screenshot of Selected record value passed to a from
Those who are couldn’t attend to this session can download the files here.
Some memories from the session

Date : 26th August 2009
Time : 6 PM onwards
Venue : Microsoft Sri Lanka Auditorium
First you have to design your InfoPath form and publish it. These are the steps.
First you have to make your form as web enabled form. For this, go to Tools ->Form Options. Form Options window will prompt. Select Compatibility from the left pane. Below window will prompt. Select first check box to make browser enable form.
![clip_image002[4] clip_image002[4]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image0024_5F00_thumb_5F00_794F234E.jpg)
Go to File menu and select Publish
![clip_image004[4] clip_image004[4]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image0044_5F00_thumb_5F00_58B7BDCF.jpg)
Publishing wizard will prompt. Select the first option. Click Next

Next you type the URL where you want to publish the form. Eg. http://moss or http://moss/sites/departments and click Next

Select the Administrator-approved option and click Next

Type your local path to save the publishing file.

Here you can map your fields as form library columns. For this tutorial I am going to ignore this step since we are not going to map any columns. Click Next

Click Publish

Click Close once you get the success message.

Now we have finished the InfoPath side of work. Open your SharePoint central administration site.
Go to Application Management

Click on Manage form templates in InfoPath Form Services
![clip_image022[4] clip_image022[4]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image0224_5F00_thumb_5F00_36573EB1.jpg)
Click on Upload form template in the Manage Form Templates window

Browse the form template you published earlier. Click Upload

Success message will appear. Click OK
![clip_image028[4] clip_image028[4]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image0284_5F00_thumb_5F00_0316F149.jpg)
Once you have done this, you will be redirected to Manage Form Templates window. Now you can see your form template in the list.
We have to activate the form template to access from the site collection. Click on the name of the form template and it will open a drop-down menu. Select Activate to a Site Collection to active the form template.
![clip_image030[4] clip_image030[4]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image0304_5F00_thumb_5F00_7FA533D3.jpg)
You will get the success message below and click OK.
![clip_image032[4] clip_image032[4]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image0324_5F00_thumb_5F00_0EE87016.jpg)
At this point we have finished uploading the form template. Now we have to activate it from the site collection to enable for users. Go to Site Settings in the Site Action menu
![clip_image034[4] clip_image034[4]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image0344_5F00_thumb_5F00_54E9075C.jpg)
Select Site Collection Features in the Site Collection Administration.
![clip_image036[4] clip_image036[4]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image0364_5F00_thumb_5F00_35668AFC.jpg)
In the Site Collection Features window you can see your form. Click Activate to enable for users.
![clip_image038[4] clip_image038[4]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image0384_5F00_thumb_5F00_19D1632C.jpg)
Now go back to the site and click View all site content -> Create to create a form library. Click on Form Library in Libraries to create.

Type a meaning full name and click Create.

You will be redirect to the newly created form library. Click Setting -> Form Library Settings to view library setting.

Click Advance settings in General Settings to change some settings to make the form view as web page.

Change Allow content types to yes and Opening browser enabled documents to Display as a web page. Click OK

Now come back to Form library settings page and this time it has changed. Click on Add from existing site content types to add your form template.

Select your form template from the left istbox and click Add. Click OK.
![clip_image052[4] clip_image052[4]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image0524_5F00_thumb_5F00_66411A69.jpg)
No go back to the Form library click New. It will prompt a menu with your form template. Click on it to view your form template.

This will be the final outcome of your form template.![clip_image056[4] clip_image056[4]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image0564_5F00_thumb_5F00_3967EF29.jpg)
Hi Techies,
MS has released SharePoint 2010 Sneak Peek. There are 3 videos (Overview, IT Professional and Developer) that discusses some of the new features. Details on the other features yet to come
Recently one of my colleagues wanted to import some extra user profile properties and show them in the People and Groups list. So I thought of writing a post here.
In SharePoint 2007 by default you don't get all the properties sync with AD user profile properties. If you install a fresh SharePoint server and check in the User profile and Properties, you will get only few properties that have been synced.
You can go to Central Administration -> Shared Services Administration ->SharedServices1 (your SSP name). Under User Profiles and My Sites you will find User profiles and properties. Once you click you will get a screen below.

Click Start full import. Then all the SharePoint user profile properties will be filled with AD user properties.
I
will also show on how to import AD property sync with a custom
property. First we need to create a property in the User Profile and
Properties > View Profile Properties. Click on New Property and will
get the screen below. I have shown the Edit screen as the example.
You just give meaning full names for Name and Display Name.
![clip_image001[9] clip_image001[9]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image0019_5F00_thumb_5F00_7CA7B7A9.jpg)
When you scroll down the form you will see as shown below. Here in the Policy Settings, you have to change the Default Policy Setting to Everyone. That will allow everyone to see the custom property of all users. In the Display Settings check the “Show in the profile properties section of the user's profile page” checkbox. That will allow users to see the custom property in the user’s profile page. Finally select the AD property from “Data source field to map” dropdown which you want to map with the custom property. Keep other fields as default.
![clip_image001[12] clip_image001[12]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image00112_5F00_thumb_5F00_338D5C17.jpg)
Save the form and go back to the User Profiles and Properties and do a full import by clicking Start full import. After completing the import go to View user profiles and select a user. Select the edit menu and check the changes with newly added custom property.
![clip_image001[15] clip_image001[15]](http://technetsrilanka.net/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/danushkas/clip_5F00_image00115_5F00_thumb_5F00_254ACF28.jpg)
Now go to the site -> People and Groups -> List Settings. Select the Detail View in Views and you can see the custom property we created before. Select the new property to display in the view. Here you can create a new view and make it as default view without editing the Detail View if you want.

Now users can see the custom property in People and Groups list.
Hi All,
We are very excited to see how will SharePoint 2010 be? Now MS has announced that SharePoint 2010 will be released early 2010. This is great news for us techies. You can see what Chris Capossela, Senior Vice President of Microsoft's Information Worker Product Management Group has told http://sharepoint.microsoft.com/product/Pages/news-and-reviews.aspx
Now when we think about the next version of SharePoint, first concern will be the hardware requirements that will support the new version. This might be one of the key factors when we migrate to the new version. When planning and budgeting need to concern the system requirements. So please go to the Preliminary System Requirements http://blogs.msdn.com/sharepoint/archive/2009/05/07/announcing-sharepoint-server-2010-preliminary-system-requirements.aspx and get ready for the SharePoint 2010.