Get SharePoint Webpart Usage Report

  During an extranet migration to office 365 we need to find out a custom content editor webpart usage.  That web part was used in many location that I would be waste of time to find all the references. I decided to write a query again extranet site content database to find out webpart usage. The first thing we need is the “Webpart type ID”. Download this tool from http://easywebparttypeidgen.codeplex.com/releases/view/48886  and follow the instruction http://easywebparttypeidgen.codeplex.com/  to retrieve webpart type ID. Now open SQL management studio and run the below query against SharePoint site content database. Note:  Make sure that you have replaced the 'Webpart type ID here' with the right 32 digit webpart type id in the below query before you run it. SELECT DISTINCT D.SiteID, D.WebId, W.FullURL as WebURL, D.Id As DocumentId, D.DirName, D.LeafName, tp_ID As WebPartSK FROM       dbo.Docs D WITH (nolock)  INNER JOIN dbo.Webs W WITH (nolock) ON D.WebID = W.Id INNER JOIN dbo.WebParts WP WITH (nolock) ON D.Id = WP.tp_PageUrlID WHERE WP.tp_ListId Is Null AND WP.tp_Type Is Null AND WP.tp_Flags Is Null AND WP.tp_BaseViewID Is Null AND WP.tp_DisplayName Is Null  AND WP.tp_Version Is Null AND WP.tp_WebPartTypeId='Webpart type ID here' Run the query and you will see the result table with all webpart references. If you have multiple content databases then you can run this query against each of them to find all webpart references.  

Custom rich text editor styles for Content editor web part

3. May 2012 03:51 by Rashid Aziz in   //  Tags: , ,   //   Comments
  I received a request from business to restrict site editor not to use OOTB fonts and styles while they edit the contents of “Content editor web part” in SharePoint 2010. This is nice to have if you want consistent look and feel across the site without much end end-user training.  They asked me to create custom styles; apart from those styles the editor should not be able to apply any font, colours or styles on CEWP contents. I have done these changes on “Page Layout”. If an editor creates any page using that page layout, he/she will only see custom styles while editing the “content editor web part” contents. Below are the detailed steps to achieve this kind of functionality 1. Create custom CSS file (In my case I will call it “CustomRTStyles.css”) with custom styles , also hides OOTB fonts and mark-up styles options and upload it to “/Style Library/en-us/Core Styles/ CustomRTStyles.css” (Change the below CustomRTStyles.css style sheet according to your requirement) /* Custom rich text editor Styles list */ .custom-rteStyle-Heading1 {-ms-name:"Heading 1";  color:#FF0000;  font-size:30px;  font-family:"Gill Sans MT";  font-weight:bold;} .custom-rteStyle-Heading2 {-ms-name:"Heading 2";  color:#000000;  font-size:24px;  font-family:"Gill Sans MT";  font-weight:bold;} .custom-rteStyle-Heading3 {-ms-name:"Heading 3";  color:#000000;  font-size:20px;  font-family:"Gill Sans MT";  font-weight:bold;} .custom-rteStyle-Heading4 {-ms-name:"Heading 4";  color:#000000;  font-size:18px;  font-family:"Gill Sans MT";  font-weight:bold;} .custom-rteStyle-Paragraph {-ms-name:"Paragraph";  color:#969393;  font-size:14px;  font-family:"Arial, Helvetica, sans-serif" } .custom-rteStyle-IntroParagraph {-ms-name:"Intro Paragraph";  color:#000000;  font-size:12px;  font-family:"Arial, Helvetica, sans-serif"} /* To hide fonts tab */ #Ribbon\.EditingTools\.CPEditTab\.Font {  display:none;}  /* To hide Markup styles tab */ #Ribbon\.EditingTools\.CPEditTab\.Markup {display:none;} 2. Open the default master page in SharePoint 2010 designer and add the reference to newly created CSS style-sheet.  // <link rel="stylesheet" type="text/css" href=" /Style%20Library/en-us/Core%20Styles/CustomRTStyles.css" /> Now save and publish the master page. 3. Open the page layout in SharePoint designer on which you what to apply custom editing styles. 4. Locate the RichHtmlField and add the following properties PrefixStyleSheet="custom-rte" AllowFonts="false" The < RichHtmlField > control with look like the following // <PublishingWebControls:RichHtmlField FieldName="PublishingPageContent"  HasInitialFocus="True" PrefixStyleSheet="custom-rte" AllowFonts="false" MinimumEditHeight="400px" runat="server"/> Reference custom css inside page layout just before the <PublishingWebControls:EditModePanel> control  // <SharePointWebControls:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/~language/Core Styles/CustomRTStyles.css %>" runat="server"/> 5. Now add the jquery to force the “Content editor web part” to use custom styles while editing any contents.  Locate the <PublishingWebControls:EditModePanel runat="server"> and add the scripting inside it, the end result will look like following <PublishingWebControls:EditModePanel runat="server"> <!-- Styles for edit mode only--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> ExecuteOrDelayUntilScriptLoaded(function() {  // window.setTimeout(function() {  $("div[RteRedirect]").each(function() { var id = $(this).attr("RteRedirect"), editSettings = $("#" + id); if(editSettings.length > 0 && editSettings[0].PrefixStyleSheet != 'custom-rte') { editSettings[0]['PrefixStyleSheet'] = 'custom-rte'; editSettings[0]['StyleSheet'] = '\u002fStyle Library\u002fen-US \u002fCore Styles\u002fCustomRTStyles.css';  RTE.Canvas.fixRegion(id, false);  }  }); // }, 2000); }, "sp.ribbon.js"); </script> </PublishingWebControls:EditModePanel> 6. Save and publish the page layout. 7. Now create new page in SharePoint 2010 page library by using updated page layout and add “Content editor web part”. The rich text editing tool will look different. I have attached the before and after images to give you guys feelings how the end results would look like.   Before changes   After changes

SharePoint 2010 library “New Document” option is greyed out

3. May 2012 03:47 by Rashid Aziz in Sharepoint blogs  //  Tags: ,   //   Comments
 We have upgraded a SharePoint intranet site form SharePoint 2007 to 2010. While I was fixing the minor issues in new site I came across this issue. I could not create any document in document library because the “New Document” option was greyed out in ribbon as shown below. There was not any issue with permissions as I was the site collection administrator. There are couple of different options to try to fix this issue. Enable “Client Integration” in web application settings. Disable “User Access Control” UAC .Check the following article http://www.petri.co.il/disable-uac-in-windows-7.htm Go to Library > Library settings > Advanced settings  > and  Allow management of content types to TRUE

Change authentication mode in SharePoint 2010

 In the following article I will explain how to change SharePoint 2010 authentication mode. In the following example I will change authentication provider of SharePoint 2010 web application from windows authentication to claim base authentication. To do this you need to user SharePoint 2010 management shell Go to start menu > All programmers > SharePoint 2010 products > SharePoint 2010 management shell Type and execute the following command $WebAppName = “http://eblogin.com” $account = “SPdomain\ebloginAdmin” $wa = get-SPWebApplication $WebAppName Set-SPwebApplication $wa –AuthenticationProvider (New-SPAuthenticationProvider) –Zone Default A confirmation message will appear, type "Y" and press enter Now check the authentication provider from central admin. It should show "claims based authentication".

Testing custom solution options for SharePoint Online (office 365)

10. April 2012 06:13 by Rashid Aziz in Sharepoint blogs  //  Tags: , ,   //   Comments
Deploying and testing solution to SharePoint online is different from SharePoint on premises environment. For SharePoint online we can only create sandbox solutions which are site collection scoped. There are two options for SharePoint online testing environment 1. Create new site collection Our goal here is to provide separate environment for testing solutions. SharePoint sandboxed solutions are site collection scoped, so we can create new site collection for testing custom solution before deploying it to production site collection. This option will not work if your code required making changes on tenant level.  E.g. if you are making use of BCS, this might be not a good option. 2. New Office 365 account (tenant) If you want to make sure that there should be a separate environment for testing in cloud, then consider this option. You can buy a test environment license for few users, or a 30 days trial version can be used for testing purpose.

SharePoint 2010 rich text editing tool styles

I came across a scenario where my client wants SharePoint extranet site contents look and feel consistent. The site have many sub sites and which lot of publishing pages, editors can create pages, add content editor web part and add contents. The request routed to me about deleting some custom styles from content editing tool and adding some new ones. Solution Open the current “Master” page in SharePoint 2010 designer. Click “Style” tab from designer menu and select “Manage styles” Right click any CSS style from” Manager Style” list  and select “Go to code” The core CSS file has all styling references ; the style starts with name “.ms-rteStyle”. Create new styles as .ms-rteStyle-stylename {-ms-name:"Eblogin Style"; color:#00adee;} Save the Core.css file Note: YOU CAN ALSO DELETE THE EXISTING STYLES BEFORE SAVING THE CSS FILE Open the SharePoint site and go to a page which has content editor web part. Edit any content inside the content editor web part and try to select the style from editing tool. You will see new style as shown below

SharePoint 2010 WSRP Viewer WebPart Configuration

19. January 2012 04:24 by Rashid Aziz in Sharepoint blogs  //  Tags: , ,   //   Comments
In SharePoint only a user can connect a WSRP viewer web part to a trusted producer. Any producer that has been configured for use in the farm by the SharePoint administrator is known as trusted producer. End users are restricted to add trusted producers and cannot override the settings so that end users and sharepoint environment can be protected from malicious remote portlet. How to add a trusted: SharePoint administrator have to create a TrustedWSRPProducers.config file in the “C:\program files\Microsoft Office Server\14.0\Config” folder on the SharePoint web front ends.   TrustedWSRPProducers.config  sample file:  <Configuration > <Producer Name="NetUnity" AllowScripts="true"> <ServiceDescriptionURL>http://wsrp.netunitysoftware.com:80/WSRPTestService/WSRPTestService.asmx</ServiceDescriptionURL> <RegistrationURL>http://wsrp.netunitysoftware.com:80/WSRPTestService/WSRPTestService.asmx</RegistrationURL> <MarkupURL>http://wsrp.netunitysoftware.com:80/WSRPTestService/WSRPTestService.asmx</MarkupURL>   <PortletManagementURL>http://wsrp.netunitysoftware.com:80/WSRPTestService/WSRPTestService.asmx</PortletManagementURL> </Producer> </Configuration>  Now place the file “C:\program files\Microsoft Office Server\14.0\Config” folder on the SharePoint web front ends a user can configure the WSRP Viewer web part. After adding WSRP viewer web part to a site the designer or administrator have to open up the web parts configuration panel to modify a few settings. Producer Modification:   A drop down lists out available producers TrustedWSRPProducers.config file.   After the producer is selected the portlet drop down selector will populate with the available values for the selected producer. Select the desired portlet, click the OK button to save these settings.                         For additional configuration SharePoint site must be switched to edit mode and then the Edit Web Part option needs to be selected from the WSRP viewer web part drop down menu. Edit mode display the web parts configuration tool pane along with displaying additional portlet configuration information in the location of the web part on the SharePoint site. The webpart will display the news feed from yahoo as shown below. WSRP is one of many portals when working with SharePoint 2010. SharePoint’s business connectivity services and creating custom data view webParts from web services  using SharePoint Designer.  

How to display list data in SharePoint 2010 chart web part

In this exercise I will show you how to use the Chart Web Part to provide a simple way to provide charts on a Web Part page so that users can visualize data in native lists within a SharePoint site as well as external lists created with the BCS, I have create a simple list for chart data, but keep in mind that you can use data from backend systems like using BCS external content types. I have created a list called “Sales list” which has two main columns, “Country” and “Revenue” with some data in it, as shown in below image. The Chart Web Part is part of the Enterprise Edition of SharePoint Server 2010. Therefore, you must activate an enterprise feature on your site collection before using chart web part. Activate Enterprise Features Go to Site Actions > Site Settings Select “Site collection features” under “Site collection Administration” section Activate feature called “SharePoint Server Enterprise Site Collection features” Navigate back to the Site setting page Select “Manage site features” under “Site action” section Activate the feature called “SharePoint Server Enterprise Site features”. Activation of these features makes the Chart Web Part available to use. Adding and configuring Chart Web Part Go to site home page or where you want to add web part. Select “site action” > edit page Click on “Add a web part” Select the “Chart Web Part” from the “Business Data” folder and click the Add button place I ton the page. Once the Chart Web Part has been added to the page, you should see a link with the caption of Data & Appearance. Click on the link which will launch a wizard and will allow you to select a data source. On the first page of the wizard, click the link “Connect chart to data”. Now select a data source. Choose “Connect to a List” and click “Next”. On the next page it ask you to choose a source list, in my case it will “Sales list” Next page will show you the data from list just click “Next” In the final wizard Page it will ask to bind your chart with the select, You need to select X and Y filed from the list, In my case Y Field:  Revenue X Field: Country After you bind list column with chart click “Finish” You will see the basic chart as shown below.     Note: If you want to change chart type (e.g. pie chart, lines chart), on the first page of the wizard click “Customize Your Chart” and select your shape and click “Finish”. J I have customized chart type to pie later as shown below.     

How to configure PerformancePoint service in sharepoint 2010

Today I will show you how to configure PerformancePoint service in SharePoint 2010. The PerformancePoint service is integrated in sharepoint 2010 environment. The PerformancePoint service is sharepoint 2010 enterprise feature, as long as you have enterprise feature switched on the PerformancePoint service will be available. Installing PerformancePoint Service Application Make sure that you have enterprise version of SharePoint 2010 installed. Open sharepoint 2010 central admin site Click on Manage Service Applications under Application Management Click on new from top ribbon and select “PerformancePoint Service application” Provide the service app name, SQL database configuration, application pool and select security account for App Pool. Click ok, you will see the following if “PerformancePoint Service application” installed successfully. Starting the PerformancePoint service Open the SharePoint 2010 central administration go to > System Settings > Manage services on server (under Servers category) Click the start link to start “PerformancePoint Service”; you will get the following when it is started. Setting up a secure store account You cannot access the performance points unattended service account to connect to data sources without secure store account. Open sharepoint 2010 central admin site Click on Manage Service Applications under Application Management Click on the Secure Store Proxy and click Manage from the top ribbon You will get a message saying ‘Generate a new key’, Click Edit on the ribbon then say Generate a new key Setting up unattended service account Open sharepoint 2010 central admin site Click on Manage Service Applications under Application Management Click on “PerformancePoint service application” link From setting page click on the first link “PerformancePoint Service Application Settings” In the “Unattended Service Account” section, enter the username and password for querying the data sources Activate PerformancePoint Site Collection feature Open your Business Intelligence site and navigate to Site Actions > site settings > Site Collection Features (option under “Site Collection Administration” tab) and active the “PerformancePoint Site Collection features” and shown below.    You have done all configurations, for testing the configuration Open a Performance Point “Business Intelligence Centre” site and click on “Run Dashboard Designer” button. If you have effectively created a PerformancePoint site collection, you should be able to do the followings Able to browse to the BI Centre Can launch Dashboard Designer Should be able to connect to a data source using the unattended service account

How to configure PerformancePoint service in sharepoint 2010

 Today I will show you how to configure PerformancePoint service in SharePoint 2010. The PerformancePoint service is integrated in sharepoint 2010 environment. The PerformancePoint service is sharepoint 2010 enterprise feature, as long as you have enterprise feature switched on the PerformancePoint service will be available. Installing PerformancePoint Service Application Make sure that you have enterprise version of SharePoint 2010 installed. Open sharepoint 2010 central admin site Click on Manage Service Applications under Application Management Click on new from top ribbon and select “PerformancePoint Service application” Provide the service app name, SQL database configuration, application pool and select security account for App Pool. Click ok, you will see the following if “PerformancePoint Service application” installed successfully.   Starting the PerformancePoint service Open the SharePoint 2010 central administration go to > System Settings > Manage services on server (under Servers category) Click the start link to start “ PerformancePoint Service”; you will get the following when it is started.   Setting up a secure store account You cannot access the performance points unattended service account to connect to data sources without secure store account. Open sharepoint 2010 central admin site Click on Manage Service Applications under Application Management Click on the Secure Store Proxy and click Manage from the top ribbon You will get a message saying ‘Generate a new key’, Click Edit on the ribbon then say Generate a new key Setting up unattended service account Open sharepoint 2010 central admin site Click on Manage Service Applications under Application Management Click on “PerformancePoint service application” link From setting page click on the first link “PerformancePoint Service Application Settings” In the “Unattended Service Account” section, enter the username and password for querying the data sources   Activate PerformancePoint Site Collection feature Open your Business Intelligence site and navigate to Site Actions > site settings > Site Collection Features (option under “Site Collection Administration” tab) and active the “PerformancePoint Site Collection features” and shown below.    You have done all configurations, for testing the configuration Open a Performance Point “Business Intelligence Center” site and click on “Run Dashboard Designer” button. If you have effectively created a PerformancePoint site collection, you should be able to do the followings Able to browse to the BI Centre Can launch Dashboard Designer Should be able to connect to a data source using the unattended service account    

Stay connected

SharePoint Links

Month List