SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

Creating custom Views on Surveys

Creating Views on Surveys is something that does not work out-of-the-box and this functionality is nowhere in the GUI. However, I was able to use a URL "hack" to get this done; one to Create the View and one to Edit it. Then I used Designer 2007 to add certain Columns; the 1 to 10 scale data types would aways be hidden. So I had to use Designer to add them manually in XSLT View. This also gave me an opportunity to add Column Filtering to this data and remove the "#" signs (??) in the data, just leaving the number the User chose in the 1-10 scale for a question. See the bottom of this article, I will detail this in another Post. Also check out Paul's post mentioned at the bottom of this article, Customized views of a SharePoint Survey .

My main requirement here was reporting & SSRS wasn't yet set-up. And a bug in the "Export to Spreadsheet" led me to Views as a solution. The Export function was leaving out the datetime stamps for Created, Modified and similar. I believe a few other key pieces of Metadata. There are also other bits of functionality that are specifically disabled / don't work in Survey Lists. Content Types are not present. Then depending on how Advanced Settings are configured (specifically Read Access and Edit Access), Workflow and Alerts do not work correctly. For example, when you lock the Survey down to "Only their Own" (posts) you will get the error "You cannot create alerts for lists for which users can only read their own items." when you try to set-up Alerts for yourself/your group. With "Only their Own" enabled, Workflow will not function correctly and you will get "Error: {workflow name} failed to start, Workflow canceled: Workflow {workflow name} was canceled by {Username}". Ok, a little off-topic here...on to the View process.

Create a custom View in your Survey:

  1. Find the Survey List ID. I usually get this just by Viewing the Source on the Overview.aspx page. Near the top of the source, SharePoint gives you the List feed. Just search on listfeed.aspx. Then get this bit: /SiteDirectory/CS/IT/_layouts/listfeed.aspx?List=6071a4f7%2Db688%2D4e83%2D8895%2De53960bf1a58".
  2. Modify the "Create View" URL to add the Survey's ID. Add in your Survey ID, making sure to swap out the URL encoded %7B to "{",left curly bracket and %7D to "}", right curley bracket. This will give you this much: http://moss-1/SiteDirectory/CS/IT/_layouts/ViewType.aspx?List={6071a4f7%2Db688%2D4e83%2D8895%2De53960bf1a58}
  3. Modify the "Create View" URL to add the Survey's Source Path. Then you just add the Link to your Surveys "All Responses" View. It would look something like this: http://moss-1/SiteDirectory/CS/IT/Lists/Test%20Views/AllItems.aspx . To complete the "Create View" URl like so: http://moss-1/SiteDirectory/CS/IT/_layouts/ViewType.aspx?List={6071a4f7%2Db688%2D4e83%2D8895%2De53960bf1a58}&Source=http://moss-1/SiteDirectory/CS/IT/Lists/Test%20Views/AllItems.aspx . Don't worry about the lack of URL encoding as this will happen once you go to this URL.
  4. Go to the "Create View" URL and choose a View Type. Choose All Responses. Standard View and the others never seems to show enough data.
  5. Name your View and add Columns for display: From here, it is just standard stuff, although i would recommend selecting almost ALL of the available Columns as a start. 
  6. Review your new View (from the View dropdown).

Then Editing the View is the same process; you use an "Edit View" URL from the same site on a List. It makes sense to Bookmark/Save these links as I ended up Editing the custom View quite a bit. EDIT: I like Paul's method for Editing the Views, once they are created. See his post on Customized views of a SharePoint Survey . This got me thinking & it seems possible to use Designer to Copy/Rename the All Responses View and then Edit it with the GUI or Designer. 

In my next Post, I will detail how to add Columns in Designer on the View's ASPX page. Essentially, I needed to add the 1-10 question data type columns, massage the data (string manipulation) and turn on Column Filtering. The first step is to open the ASPX page, highlight the ListViewWebPart and Choose 'Convert to XSLT Data View'. More later...


Posted 04-02-2008 9:19 AM by ggill1970

Comments

AutoSponge wrote re: Creating custom Views on Surveys
on 04-02-2008 11:00 AM

Great minds think alike!  I'll comment my article to include a link here.

You can also get the List and View guids by right-clicking and copying the URL on "Edit the current view" in the web part configuration panel.

Nishant Rana wrote re: Creating custom Views on Surveys
on 11-25-2008 6:18 AM

Thanks !! :)

Leveraging the SharePoint Platform (Part 2) | THE GLOBAL DEVELOPER wrote Leveraging the SharePoint Platform (Part 2) | THE GLOBAL DEVELOPER
on 12-04-2008 6:28 AM

Pingback from  Leveraging the SharePoint Platform (Part 2) | THE GLOBAL DEVELOPER

sal wrote re: Creating custom Views on Surveys
on 02-25-2009 3:59 PM

Once this new view is created, can we export to datasheet from this view? I tried and it continues to export from the original view

Ramya wrote re: Creating custom Views on Surveys
on 03-02-2009 12:23 AM

Dear Sir,

i want to add columns in survey list. it is poossible.

pls suggest.

#@$% wrote re: Creating custom Views on Surveys
on 03-25-2009 7:31 AM

#$@!#$@!#$@!#$@!#$@!#$@!#$@! Microsoft is stupid

QuocThu wrote re: Creating custom Views on Surveys
on 05-07-2009 3:06 AM

Hi you! I'm from VietNam. I have trouble with workflows created by SharePoint Designer. It always informs that "Workflow name failed to start, WF name was cancelled by ... account.

Thanks for your help!!!

(My yahoo messenger: tqtbtc@yahoo.com)

Michael Hanley wrote re: Creating custom Views on Surveys
on 05-25-2009 8:22 AM

Fantastic! Thanks for the help guys - got me out of hole and saved me from half a day's SP Designer development hell!

Geoff wrote re: Creating custom Views on Surveys
on 06-16-2009 2:34 PM

"Once this new view is created, can we export to datasheet from this view?" -- i was not able to do the datasheet, but was able to "export to Spreadsheet". i think this would involve a JS edit to the navigational toolbar.

"i want to add columns in survey list. it is poossible." -- i believe so, just use the SharePoint GUI: settings | survey settings | add a question. then use SharePoint Designer to change the column data type.

"It always informs that "Workflow name failed to start, WF name was cancelled by ... account. -- i think you are havng this issue ? "www.sharepointblogs.com/.../sp-designer-automatic-new-item-workflows-are-not-starting-when-logged-in-as-service-account.aspx

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.