Friday, June 6, 2014

Working with Chart Web Part in SharePoint

In this post, we will discuss how to populate a chart web part from a SharePoint list. Here I am using chart web part in SharePoint 2013. Though Microsoft removed chart web part, you can check this workaround to make chart web part available in SharePoint 2013.

Also, you can check out:

- Microsoft Flow Step by Step Tutorial with Examples

- How to get Absolute URL of List using SharePoint object model?

- Backup and Restore Site Collections in SharePoint 2010 using PowerShell

- Vertical flyout menus in SharePoint 2010

Here I have a SharePoint list name as "Course" which has 5 columns and the data are like below:

chart web part sharepoint 2010

Here I want to show a chart (bar) and want to see in Sharepoint 2013 how many trained, novice, intermediate and expert people. Similarly for SharePoint 2010, Asp.net and C#.Net skills.

For this first add a chart web part to the page (Edit Page -> INSERT -> Web Part). Once you will put the chart it will appear like below. Save the page.



chart web part sharepoint 2013


After that click on Data & Appearance. Then select Connect Chart To Data as shown in the fig below:

chart web part sharepoint 2016

In the next step select "Connect to a List" in the Choose a Data Source section. Then click on Next.

chart web part sharepoint online

In the next step select the site and the list in the drop down.

In the next step, it will show you the list and the data. Click Next.

The 4th Step Bind Chart to Data is an important step. Follow below instruction. Here

In the Series expand (click on +) Series Properties. Enter the name, here I am putting based on my column names. It should be like below:

Series Name: Trained
Series Type: StackedColumn (From the drop-down select the column).
Y Field: Trained (Select Trained Column from drop down)
X Field: Title (Remember this will be the same for all series)

So it will appear like below:


Then click on the + icon near series like below:


Here also fill the series details like below:

Series Name: Novice
Series Type: StackedColumn (From the drop down select the column).
Y Field: Novice (Select Novice Column from drop down)
X Field: Title (Remember this will be same for all series).

So it will appear like below:


Add all based on the columns. Here I added 4 for each column (Trained, Novice, Intermediate and Expert).

Then click on Finish.

Now your chat will appear like below:


If you want to customize a bit like you want to show the count as well as a image in the top right corner follow below steps.

Here click on Data & Appearance, then click on Customize your chat.

Here select Stacked Column and click Next as shown in the fig below:

Chart Web Part in SharePoint 2013

You can set the width and Height of the chart web part. then click on Next.

The next step is very important, if you want to Show Legend then you chose Show Legend.

Chart Web Part in SharePoint 2010

You can go to the Axis and Gridlines tab and if you do not want the Major Gridlines then you can deselect "Show Major Grid Lines" for both X and Y axis.

If you want to show the Labels then you can select the Label and click on Finish.

Chart Web Part in SharePoint 2016

Finally, your chart will appear like below:

Chart Web Part in SharePoint online

Monday, March 24, 2014

Create web part page in SharePoint 2013

Here i am going to explain how to create web part page in sharepoint 2013.

Also you can check out:

- Add custom web part properties to visual web part in SharePoint 2010

- Content Editor Web Part in SharePoint 2010

- how to use css in visual web part in sharepoint 2010

1. Go to site Content -> Click on Site asset.

2. Now click on Files tab,then expand the New Document dropdown and choose Web part page.

3. Now Provide the details as below.


4. Click on OK and your web part is created in site page.

5. Go to the site page and click on your web part page and start adding your webpart.

Thursday, February 13, 2014

SharePoint 2013 client object model

In this post we will discuss about  various client object model in SharePoint 2013. Also you can check out some posts on:

- Enable Sign in as Different User Option in SharePoint 2013

- Architectural changes in SharePoint 2013

- How to get userprofile properties in SharePoint 2013 object model?

In SharePoint 2013, there were 4 client object models: Managed object model, Silverlight object model, Mobile object model and JavaScript object model.

Here we will discuss about various client object model.

Silverlight object model:
By using Silverlight object model, you can build Silverlight applications, Web Parts, Asp.Net applications, apps for SharePoint and Office, and Silverlight applications for phones that use SharePoint data or SharePoint objects.

The Silverlight client object model dlls are presented inside %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\LAYOUTS\ClientBin folder.

Microsoft.SharePoint.Client.Silverlight.dll

Microsoft.SharePoint.Client.Silverlight.Runtime.dll

Microsoft.SharePoint.Client.DocumentManagement.Silverlight.dll

Microsoft.SharePoint.Client.Publishing.Silverlight.dll

Microsoft.SharePoint.Client.Search.Applications.Silverlight.dll

Microsoft.SharePoint.Client.Search.Silverlight.dll

Microsoft.SharePoint.Client.Taxonomy.Silverlight.dll

Microsoft.SharePoint.Client.UserProfiles.Silverlight.dll

Microsoft.SharePoint.Client.WorkflowServices.Silverlight.dll

Microsoft.Office.Client.Policy.Silverlight.dll

Microsoft.Office.Client.TranslationServices.Silverlight.dll

So according to your rwquirement you can use the above dlls to work with silverlight application.

Example of Silverlight client object model:

In this example, we will see the item count for a list.

using (ClientContext clientContext = ClientContext.Current)
{

List objList = clientContext.Web.Lists.GetByTitle("MyList");

clientContext.Load(this.objList);

lblResultCount = this.objList.ItemCount.ToString();

}

It will show number of items in the list.

Mobile client object model:
The Mobile object model can be used to create applications that run on Windows Phones. The Mobile client-side object model contains some functionality that is specific to phones, such as APIs that enable a phone app to register for notifications from the Microsoft Push Notification Service.

The required dlls are found inside %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\LAYOUTS\ClientBin folder.

The dlls are:
Microsoft.SharePoint.Client.Phone.dll

Microsoft.SharePoint.Client.Phone.Runtime.dll

Microsoft.SharePoint.Client.DocumentManagement.Phone.dll

Microsoft.SharePoint.Client.Publishing.Phone.dll

Microsoft.SharePoint.Client.Taxonomy.Phone.dll

Microsoft.SharePoint.Client.UserProfiles.Phone.dll

Microsoft.Office.Client.Policy.Phone.dll

Microsoft.Office.Client.TranslationServices.Phone.dll

Managed client object model:
The Managed object model can be used to create .NET applications that run on Windows operating systems that aren't phones or SharePoint servers. The managed client object model dlls are found inside ISAPI folder.

Microsoft.SharePoint.Client.dll

Microsoft.SharePoint.Client.Runtime.dll

Microsoft.SharePoint.Client.ServerRuntime.dll

Microsoft.SharePoint.Client.DocumentManagement.dll

Microsoft.SharePoint.Client.Publishing.dll

Microsoft.SharePoint.Client.Search.Applications.dll

Microsoft.SharePoint.Client.Search.dll

Microsoft.SharePoint.Client.Taxonomy.dll

Microsoft.SharePoint.Client.UserProfiles.dll

Microsoft.SharePoint.Client.WorkflowServices.dll

Microsoft.Office.Client.Education.dll

Microsoft.Office.Client.Policy.dll

Microsoft.Office.Client.TranslationServices.dll

Microsoft.Office.SharePoint.ClientExtensions.dll

JavaScript client object model:
JavaScript client object model does not contain any dlls, rather it contains .js files. These .js files are located inside LAYOUTS folder and mainly functionality exists inside SP.js and SP.Core.js. The JavaScript object model can be used in inline script or in separate .js files.

Monday, January 13, 2014

Replace "Add New Item" Link Text to something Different Link Text in SharePoint 2010

This article explores to user's requirement is to change the "Add New Item" link text to " Different Link text", so that it will be more meaningful on a list.

Also, you can check out some posts on:

- Microsoft Flow tutorial

- Disable default email for approval workflow in SharePoint 2010 designer

- Bind dropdownlist from SharePoint list in InfoPath 2010

By default the "Add new item" appears like below:

replace add new item text sharepoint list

Follow the below steps to change the text:

1. Go to the target page >> Site actions>> Edit Page

2. Insert a CEWP just below the list view web part.

3. Place the cursor in CEWP, Click on "Edit HTML Source" link from HTML Ribbon Item's drop down menu. check fig below:


replace add new item text sharepoint 2010 list

4. In Content Editor web part enter the script:

<script type="text/javascript">
  document.getElementById("idHomePageNewItem").innerHTML="Add New InterviewTracker"
</script>

5. Save the page! see the result in action, it will appear like below:

replace add new item text sharepoint 2013 list