Thursday, February 23, 2012

Remove "Launch blog program to post" from the SharePoint 2010 blog page

Remove "Launch blog program to post" from the SharePoint 2010 blog page or Blog Tool Webpart by adding the below CSS code :

<style type="text/css">
.ms-blogAdminLinks li+li+li+li
    display: none;

You can add this CSS code to your Master Page or Use a content editor.

Saturday, February 18, 2012

Remove duplicate elements from a List

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

class Program
    static void Main()
 // List with duplicate elements.
 List<int> list = new List<int>();
Console.WriteLine("Original List");
foreach (int value in list) { Console.WriteLine("{0}", value); } // Get distinct elements and convert into a list again. List<int> distinct = list.Distinct().ToList();
       Console.WriteLine("Distinct List");
foreach (int value in distinct) { Console.WriteLine("{0}", value); } } }

Original List                                Distinct List
1                                                        1
2                                                        2
3                                                        3
3                                                        4

Thursday, February 16, 2012

Create a Chart Dynamically in SharePoint 2010

        public void DrawGraph(DataTable dt, string chartTitle)
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("<script type='text/javascript' src=''></script>");
            sb.AppendLine("<script type='text/javascript'>");
            sb.AppendLine("google.load('visualization', '1', {packages:['corechart']});");
            sb.AppendLine("function drawChart() {");
            sb.AppendLine("var data = new google.visualization.DataTable();");
            sb.AppendLine("data.addColumn('string', 'Title');");
            sb.AppendLine("data.addColumn('number', 'Rating');");
            sb.AppendLine("data.addRows([ ");
            foreach (DataRow drow in dt.Rows)
                sb.AppendLine("['" + drow["Title"] + "'," + drow["Rating"] + "],");
            sb.AppendLine("var options = {");
            sb.AppendLine("width: 800, height: 360,");
            sb.AppendLine("title: '" + chartTitle + "',");
            sb.AppendLine("hAxis: {title: 'Title', titleTextStyle: {color: 'white'}}};");
            sb.AppendLine("var chart = new google.visualization.ColumnChart(document.getElementById('chart_div" + chartTitle.Substring(0, 2) + "'));");
            sb.AppendLine("chart.draw(data, options);      }   ");
            sb.AppendLine("<div id='chart_div" + chartTitle.Substring(0, 2) + "'></div>");
            pnlChart.Controls.Add(new LiteralControl(sb.ToString()));

For More Chart Controls check the below link
Google Charts

Tuesday, February 7, 2012

SharePoint Site Error: Service Unavailable HTTP Error 503. The service is unavailable

When opening My SharePoint site it giving me the error ‘Service Unavailable HTTP Error 503. The service is unavailable’ and I was not able to access either of them.

It was stopped at the IIS when i'm start manually i got the same error. I realized that I had just changed the password of my account. So here is share what I did to solve the problem.

1. Open up IIS Manager and click on 'Application Pools'.

2. Locate your App Pool account and right-click on it and select 'Advanced Settings'.

3. Under the Process model Group click on 'Identity' then Application Pool Identity Pop up is opened Click on 'Set' and re-enter My User Name, Password and Confirm Password then click on 'OK'.

Error is cleared...

Hope it will help you...

Thursday, February 2, 2012

Using PowerPoint 2010 themes in SharePoint 2010 In 6 Easy Steps

Creating your own theme for SharePoint 2010 used to be similar to dark alchemy, so one of the things that I thought I would share with you is how easy it is to create your own theme for SharePoint 2010 just using PowerPoint 2010.

1. Choose which theme to apply to your PowerPoint presentation

2. Save as a .thmx file

3. In SharePoint navigate to Site Settings -> Site Theme and then at the top of the page choose Theme Gallery

4. Click ‘Add New Item’ and then browse to where you saved your theme

5. Now Click OK and Save

6. Then navigate back to Site Settings -> Site Theme and your new theme will be available to choose and apply

You can from here apply more tweaks until you are happy with your new colour scheme.

Sharepoint Error Message: Your client does not support opening this list with Windows Explorer

How to launch a document by clicking a link to the file?

Word: <a href='ms-word:ofe|u|path/to/web/word/document.docx'>Link to document</a> Excel: <a href='ms-excel:o...