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/Bookmark

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/Bookmark

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/Bookmark

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/Bookmark

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/Bookmark

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/Bookmark

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/Bookmark

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/Bookmark

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/Bookmark

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/Bookmark

Leggi tutto