Nick Grattan's Blog

About Microsoft SharePoint, .NET, Natural Language Processing and Machine Learning

Archive for the ‘SharePoint 2010’ Category

Chart Web Part: Hiding “Data & Appearance” and “Advanced Properties”

with 13 comments

The “Chart Web Part” shipped with SharePoint 2010 does a reasonable job of displaying graphs. However, when added to a web part page, it displays “Data & Appearance” and “Advanced Properties” links which can be annoying:

The links cannot be hidden through the web part configuration user interface. Instead you need to:

  1. Open the ASPX page in Microsoft SharePoint Designer 2010.
  2. Locate the Chart Web Part in Code View.
  3. Edit the ShowToolbar property from “True” to “False”.
  4. Save changes.

Now these links will be hidden. You can use the standard drop down web part menu to access them if you need to without re-enabling them:

Written by Nick Grattan

February 15, 2011 at 7:40 pm

SharePoint: Opening CSV files with Microsoft Excel

with 10 comments

By default, if open a .CSV file in a SharePoint the browser will prompt you to save the file. Ideally, you probably want the file to be opened directly in Microsoft Excel. There are two configuration options that need to be made. The instructions here are for SharePoint 2010 but are similar for SharePoint 2007.

  • Add an entry to DOCICON.XML

This file is located by default at: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\XML. Open the file DOCICON.XML for editing and add the following line in the ByExtension element:

<Mapping Key=”csv” Value=”icxltx.png” OpenControl=””/>

This ensures that the Excel icon is displayed alongside CSV files.

Note: if you want to be prompted to open read-only or for edit remove ‘OpenControl=”” ‘ in the Mapping Key.

  • Change the MIME type associated with the CSV Extension in Internet Information Server (IIS)

To do this:

  1. Run the “Internet Information Services (IIS) Manager” application from the Start/Administrative tools menu.
  2. Select the server in the left-hand pane.
  3. Select “MIME Types” in the list of options in the middle pane.
  4. Then locate the .CSV entry (it should already exist) and change the MIME type to: application/vnd.ms-excel, and click OK.

Once these configuration options are complete perform an IIS Reset.

CSV files should now be opened using Excel by default. You will be prompted that a change in file extension has occurred when using Office 2007. You will need to click Yes in this warning message.

Written by Nick Grattan

January 5, 2011 at 9:11 am

Adobe PDF IFilter Indexing with SharePoint 2010

with 40 comments

This note explains how to enable PDF indexing using the Adobe IFilter version 9.0 in Microsoft SharePoint 2010. This note is adapted from the Adobe note explaining how to configure the 64 bit IFilter for SharePoint 2007 (see: http://www.adobe.com/special/acrobat/configuring_pdf_ifilter_for_ms_sharepoint_2007.pdf ).

Now add PDF as a file type:

  • Run Central Administration.
  • Click Manage service applications under “Application Management”:

  • Click the Search Service Application link in the list of applications.

  • Click File Types  under “Crawling” in the left navigation area:

  • Click New File Type.
  • Enter pdf for the “File Name Extension” and click OK.

  • Using Regedit on the server, navigate to

\\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\Filters

  •  Right-click the Filters  folder and select New Key. Enter “.pdf” for the key value.
  • Add the following values to this key:

<REG_SZ> Default = <value not set>
<REG_SZ> Extension = pdf
<REG_DWORD> FileTypeBucket = 1
<REG_SZ> MimeTypes = application/pdf

 The key should look like:

  • Navigate to: \\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Setup\ContentIndexCommon\Filters\Extension
  •  Right-click the Filters  folder and select New Key. Enter “.pdf” for the key value.
  • Set the “default” value to {E8978DA6-047F-4E3D-9C78-CDBE46041603}

 The key should look like:

You can now add an image to be used for the icon for PDF documents:

  • Add an image (typically gif or png, use Google images to find an example) for the PDF icon to the folder:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES

  •  Open the file docicon.xml from the location:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML

  •  Add a link to map the pdf extension to the image by adding a link like the following to the ByExtension element:

                 <Mapping Key=”pdf” Value=”pdf_icon.gif” OpenControl=””/>

  •  Finally, issue an IISReset and restart the Windows services “SharePoint Foundation Search V4” and “SharePoint Server Search 1”.

Your PDF documents should now be indexed on the next indexing crawl.

 Update 15-Feb-2011: See this blog post for a useful PowerShell script that automates this process: http://www.sharepointusecases.com/index.php/2011/02/automate-pdf-configuration-for-sharepoint-2010-via-powershell/

Written by Nick Grattan

June 14, 2010 at 3:31 pm

Credentials, SharePoint Client Object Model and Silverlight

with 4 comments

When using the SharePoint Client Object Model in Silverlight, you need to add references to the Client Object Model assemblies prepared for Silverlight:

These assemblies are located in the “14” hive: \14\TEMPLATE\LAYOUTS\ClientBin. Note that when using the Client Object Model in other application types you use the libraries located in the ISAPI folder in the “14” hive (Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll).

Before executing Client Object Model calls you need to get a ClientContext object through which calls can be made. When running in a Silverlight application you can do this so:


            ClientContext clientContext = ClientContext.Current;

However, “ClientContext.Current” is only initialized when the Silverlight application is running on a page in a SharePoint site. If you run the Silverlight application on a page in another web site “ClientContext.Current” returns NULL. Creating your own ClientContext object is described in this post – the ClientContext class has a “Credentials” property which can be set through creating a new “NetworkCredentials” object.

But here’s the rub – the Silverlight Client Object Model does not support the Credentials property. So it would seem that Silverlight applications using the Client Object Model can only run in SharePoint sites.

So what about adding references to Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll instead? Doing this causes an error stating that the assemblies have not been prepared for the Silverlight environment.

Written by Nick Grattan

May 20, 2010 at 8:01 am

Automatic Activation in SharePoint 2010 Features Created with Visual Studio 2010

with one comment

Creating packages and features for SharePoint 2010 is a breeze with Visual Studio 2010. Projects support automatic feature and package deployment for list templates, web parts, site templates and others.

When creating a library template at the web scope level I couldn’t work out why my feature was becoming activated at the site collection top level site, but was inactivated in other sites in the site collection.

It turns out this is the default deployment behaviour in Visual Studio. To change, select the project in the Solution Explorer and press F4 to display the properties pane for the project. Change the “Active Deployment Configuration” property from “Default” to “No Activation”:

Written by Nick Grattan

May 11, 2010 at 12:29 pm

Posted in SharePoint 2010

Investigating SharePoint 2010 Errors

leave a comment »

In SharePoint 2007 finding more information on exception errors generated by SharePoint was not easy. It generally involves noting the time at which the error occurred and trawling through the log files looking for exception information. This is now much easier in SharePoint 2010.

When an exception is generated, the error dialog is displayed:

Each error dialog has a unique correlation id (GUID). You can search in the error logs (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS) for this correlation id to locate more information on the error.

Note: SharePoint Log files are now compressed by default.

Written by Nick Grattan

April 28, 2010 at 10:26 am

Posted in SharePoint 2010

Tagged with

Microsoft SharePoint Foundation 2010 Released

leave a comment »

Version 1.0 of Microsoft SharePoint Foundation 2010 is now available for download: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=49c79a8a-4612-4e7d-a0b4-3bb429b46595

Supported 64 bit operating systems: Windows 7 Enterprise; Windows 7 Professional; Windows 7 Ultimate; Windows Server 2008 R2; Windows Server 2008 Service Pack 2; Windows Vista Service Pack 2

Written by Nick Grattan

April 26, 2010 at 7:35 pm

Posted in SharePoint 2010

Tagged with

Can SharePoint Designer 2010 be used against Sharepoint 2007 Sites?

leave a comment »

No, Microsoft SharePoint Designer 2010 cannot open Microsoft SharePoint 2007 sites.

sd2010.PNG

I guess this is not really suprising. The good news is that SharePoint Designer 2007 and 2010 can be installed on the same PC – just remember to install 2007 first.

This blog post relates to Microsoft SharePoint 2010 beta.

Written by Nick Grattan

November 23, 2009 at 3:23 pm

Posted in SharePoint 2010

Tagged with

Microsoft SharePoint Server Enterprise 2010 Beta Download now available

leave a comment »

This link takes you to the Microsoft download page for Microsoft SharePoint Server Enterprise 2010 Beta:

http://technet.microsoft.com/en-ie/evalcenter/ee388573(en-us).aspx

You will need to register but you do not need a Technet/MSDN subscription. The product key is at the bottom of the download page.

Written by Nick Grattan

November 18, 2009 at 5:01 pm

Posted in SharePoint 2010

Tagged with