How to delete a corrupted Sharepoint list

By peter.stilgoe









Sometime you will find you have a currupted list that you cant delete through the normal way as when you try & access the list or the list settings the webpage throws errors. In this case use STSADM

stsadm.exe -o forcedeletelist -url http://devapp01/Lists/<MyListName>/

Share

Leggi tutto

Populate a Sharepoint list from an SQL Database

By peter.stilgoe









If you are wanting to populate a Sharepoint list from an SQL database or populate a SQL database from a Sharepoint list you can do this failry easily using SSIS & the SharePoint List Source and Destination Adapter project on Codeplex.

Introduction
This sample illustrates the creation of a a source and destination adapter in C#, using the public APIs for Microsoft SQL Server Integration Services. The component connects to SharePoint through a proxy dll, which wraps the complexities of working with the SharePoint Lists Webservice.

The Specific Features of the included SSIS Components are:

SharePoint Source Component
- Auto-detects all of the public fields from a SharePoint List or view of the list.
- Supports removal of fields from the output flow, which optimizes the query against SharePoint for increased performance.
- Supports restricting SharePoint data by a custom CAML query, which can be provided through a variable expression for fine tuned filtering over large lists.
- Provides a tuning feature for the # of rows to return at a time. Often with SharePoint, large lists need to be brought over in smaller batches than wide (many field) lists, or else the Webservice will die. The batchsize lets you specify a solid size that works for your list.

SharePoint Destination Component
- Auto-detects all of the editable fields from a SharePoint List
- Only fields bound to columns from the input flow will be ‘updated’, for performance.
- Supports deleting rows by ID
Included Bonus – SharePoint Utility

To simplify the adapter code and keep the SharePoint routines generic, a proxy VB.Net component is included which access the SharePoint Webservice API. It includes a very flexible api for getting SharePoint List information, which is used by the Components above. In addition, it can publish and remove files from a document library.

Component Features
Unique features that may inspire you to create great custom SSIS components:
• Extensive Validation: Validation for this component actively goes against the SharePoint Site to verify the properties are valid.
• Values from Expressions: This component supports external variables, which can be expressions, and can be attached to the source component to customize the query. Similar to the CommandText for the other Sql Components
• Linq: The Component has been written using Linq with .net 3.5 and shows how elements such as the metadata and columns can be combined to create a readable usage in a Linq format.
• Custom properties: The component keeps its configuration in custom properties on itself, inputs, and input columns.
• SharePointUtility Component: Simplifies access to the SharePoint Lists / Views WS using Linq friendly objects

Sharepoint List Source & Destination project on Codeplex




Share

Leggi tutto

Sharepoint Designer could not save the list changes to the server

By peter.stilgoe









When using Sharepoint Designer 2010 to create custom aspx list forms I was getting the error:

‘sharepoint designer could not save the list changes to the server’

I had a look on the net but couldnt really find anything relating to do with this.

I seem to have solved it by going to my list and removing duplicate column names that werent being used ie.

Consultant

Consultant #Used in CT ‘Consultant’#

I was using a custom content type so I deleted all the columns that weren’t ‘Used by’ my custom content type. Once I had done this I was them able to create custom forms as expected in SPD 2010.

Hopefully this will help some people if theyre getting similar problems!




Share

Leggi tutto

How to stop the !New tag/indicator from appearing when you add items or documents to your sharepoint site

By peter.stilgoe









When you add a new entry to announcements, to events, or to links on a Microsoft SharePoint Team Services and Windows SharePoint Services Web site, the new entry always includes a tag that is made up of the exclamation point character (!) and the word “new” (!New). This article describes how to stop the !New tag from appearing when you create a new entry.

Windows SharePoint Services 3.0 Web site (inc. MOSS 2007)

To stop the !New tag from appearing next to new entries on a Windows SharePoint Services 3.0 Web site, use the Stsadm.exe tool to change the “Days to Show New Icon” property to zero.

To do this, follow these steps:
Click Start, point to All Programs, point to Accessories, and then click Command Prompt.

Type the following commands, and then press ENTER after each command:

cd /d %programfiles%\Common Files\Microsoft Shared\Web Server Extensions\12\BIN

stsadm.exe -o setproperty -pn days-to-show-new-icon -pv 0 -url [Your Virtual Server's URL]

Share

Leggi tutto

Populating an Infopath dropdown using a specific Sharepoint list view

By peter.stilgoe









If you have a Sharepoint list containing multiple views, one view shows all approved items and another view shows all items that are pending approval. You have an Infopath form where you have a dropdown control that you want to be populated with only ‘Approved’ list items from your Sharepoint list.

If you create your Infopath data connection & copy the URL to this list view as your source you will notice it still returns ALL items as opposed to your filtered view listing only the approved items.

The way round this is to create you data connection using an XML source, use this link to find out how to view your list data as XML and get the source URL – http://www.petestilgoe.com/2009/11/converting-a-sharepoint-list-into-xml/

Now you need to expand on this & add the particular view to the url to make the data connection get the filtered data for you.

Currently your URL looks something like this:
/_vti_bin/owssvr.dll?Cmd=Display&List={GUID}&XMLDATA=TRUE&noredirect=true

1) Now in your Sharepoint list click ‘Settings’ –> ‘List Settings’

2) Scroll down to the bottom & click on the view you want to use as your datasource

3) Now your URL contains the {List GUID} as well as the {View GUID}

eg. /_vti_bin/owssvr.dll?Cmd=Display&List=%7BD66DCB51%2D80B0%2D43AB%2DB80B%2DCD7D23E63B09%7D&View=%7B6D0CEF69%2DF899%2D40D0%2D86B2%2D6E01CC7D9CA1%7D&XMLDATA=TRUE

4) The URL is encoded so you will need to replace “%7B” with “{” and “%7D” with “}” and “%2D” with “-” so now your url will look something like

/_vti_bin/owssvr.dll?Cmd=Display&List={D66DCB51-80B0-43AB-B80B-CD7D23E63B09}&View={6D0CEF69-F899-40D0-86B2-6E01CC7D9CA1}&XMLDATA=TRUE

5) Use this url as your XML data source in Infopath and your drop down data will be filtered as per your chosen view.

Share

Leggi tutto

How to autopopulate Infopath fields using Sharepoint list data

By peter.stilgoe









1) Get your Sharepoint list into XML format

2) Set up a data connection using the above XML file as your datasource

3) Now you need to configure rules and filters on your list box. Let’s say that your list box has customer name and you wish to fill a field with the customer phone. When you set your rule, you would first select Set a field’s value then select the field where you want the phone number.

4) To filter for the correct phone number, select the formula button next to the Value field. In the formula window, select Insert Field or Group.

5) Select your secondary data source and the phone number field. Select the Filter Data button. Select Add.

6) In the first drop down, select the customer name field from your secondary data source. Leave the middle one set to Is equal to. For the third drop down, select the field on your form that is bound to the control with the customer name in it.

At this point, what you are basically telling the rule is: Go get me a phone number. I want it to belong to the same customer as the one I just selected in my List Box.

If your datasource is fairly static, when creating the data connection for the XML file in the Data Connection Wizard, ensure that the option to Include the data as a resource file in the form template or template part is selected. This will enhance the speed of your data queries to your datasource significantly.

Steps taken from Hilary Stoupa over @ InfopathDev.com

Share

Leggi tutto

Import Excel 2007 Spreadsheet as Sharepoint List Error Method ‘post’ of object ‘IOWSPostData’ failed

By peter.stilgoe









If you get the following error Method ‘post’ of object ‘IOWSPostData’ failed, you can fix it by doing the below:

Do a search on you C: drive for a file named: EXPTOOWS.XLA

Open it and Enable Macros

Select the Developer tab and the Visual Bacis or press ALT+11. Same result. You are ready to alter the file.

Search for:

lVer = Application.SharePointVersion(URL)

Add a new line just below:

lVer = 2

Save and exit.

Now try the import again & it should work.

NOTE: this is a problem with excel as opposed to Sharepoint so this would need to be done on all workstations requiring the ability to import Excel 2007 spreadsheets as custom lists.

Share

Leggi tutto

Allowed anonymous access on a Sharepoint list and still get prompted for a login

By peter.stilgoe









If you have enabled anonymous access on your Sharepoint farm and you still get prompted for a login when trying to access a list, it is most likely that your list exists in a ‘Publishing Site’.

This is because by default all publishing sites have a feature called ‘ViewFormPagesLockdown’ activated. This basically provides extra security for internet facing Sharepoint sites by stopping anonymous users viewing pages like AllItems.aspx etc.

If you want anonymous users to be able to view such pages you need to disable ‘ViewFormPagesLockdown’

1 Remove all anonymous access from the site.
2 Deactivate the ViewFormPagesLockdown Feature
3 Make sure that the list inherits its permissions from its parent.
4 Do an IISreset and close all browsers.
5 Wait 60 seconds or so for everything to start backup
6 Turn anonymous access on at the site level
7 Close the browser.
8 Browse to the website as anonymous user.
9 Click on a navigation link to browse to the list in question
10 You should now be able to browse list items as an anonymous user.

Activate Feature:

stsadm -o activatefeature -url -filename ViewFormPagesLockDown\feature.xml

De-Activate Feature:

stsadm -o deactivatefeature -url -filename ViewFormPagesLockDown\feature.xml

Share

Leggi tutto

Converting a Sharepoint List into XML

By peter.stilgoe









This easiest way is to use the URL below & insert your list GUID

http://servername/site/_vti_bin/owssvr.dll?Cmd=Display&List=*YOURUNIQUELISTID*&XMLDATA=TRUE

To get the GUID of the list you need to go into the list & click ‘Settings’ -> ‘List Settings’. Now if you look at your URL you will see something like:

/_layouts/listedit.aspx?List=%7B7B476F98%2D1075%2D4A6D%2D8F63%2D4C754B3F41FC%7D

The URL is encoded so you will need to replace “%7B” with “{” and “%7D” with “}” and “%2D” with “-” so the end result would look something like: {7B476F98-1075-4A6D-8F63-4C754B3F41FC}

Share

Leggi tutto

Import data from CSV and SQL to a SharePoint list

By peter.stilgoe









This SharePoint feature allows you to quickly import data from a CSV file or a SQL stored procedure to any custom SharePoint list.

Once you have added the solution to your farm and activated it on your site collection an additional menu option will be available on the Action menu of each custom list that will take you to the import CSV or SQL page.

Simply select which option you want – either import from a CSV file or import from a SQL stored procedure. Next, browse to the CSV file or enter the SQL connection and name of the stored procedure and hit the Import button.

There is a check box option to delete all items from the list before doing the import which is not selected by default.

Click Here

Share

Leggi tutto

Charting Data From Sharepoint Lists

By peter.stilgoe









If you’re frustrated by the lack of charting ability in Sharepoint / MOSS take a look at Visifire

Using Silverlight, The Dataview Webpart & Visifire you can start charting your list data within minutes with some very smart charts!

Share

Leggi tutto

Creating an Org Chart using Visio 2007 and a SharePoint List

By peter.stilgoe









Many times during a project, you hit a requirement to have the ability to display an org chart on your SharePoint portal, and because there are many options to do this, it is difficult to know what approach is best for your particular scenario.

Here is a quick way of developing an org chart that the business users can update themselves! There are many options in terms of what data source you can use, such as Excel, MS Access, SQL Server or any OLEDB or ODBC data source.

For this scenario, we simply configure the Visio 2007 Org Chart to retrieve its data from a SharePoint List. The possibilities are endless in terms of how that data gets populated into the SharePoint List as well. For instance, you can write some code to retrieve and cleanup some data before programmatically importing it into the List.

Read more here

Share

Leggi tutto

Turbo charge your sharepoint lists by using calculated columns to write HTML

By peter.stilgoe









By inluding html in your calculated column formulas you can turbo charge your lists in Sharepoint, see:

Using HTML in calculated columns

Adding traffic light system to Sharepoint lists

Share

Leggi tutto

Sharepoint and JQuery

By peter.stilgoe









If youre not already using JQuery in your Sharepoint environment Im sure you will be in someway in the future, to get you started heres some useful links:

JQuery at EndUserSharepoint

50 JQuery examples

37 more JQuery examples

Share

Leggi tutto

Using a lookup to return data from a list on a different site

By peter.stilgoe









At first glance this doesnt look possible OOTB but it is, just not very obvious!

The way to achieve this is to:

1) Create a list at say Site Collection level which contains a column with the data in you want to use on another site.

2) Now create a Lookup column at Site Collection Level which is pointing to the data from the above list that you want to use.

3) Now you can add that column, to any list, on any site, throughout the site collection.

Share

Leggi tutto