Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sharepoint Object Model + Accessing Survey Results (Rating Scales)

Status
Not open for further replies.

NicoleM

Programmer
Oct 18, 2001
23
0
0
ZA
I am accessing values of survey on a site in Windows Sharepoint Services using the Object model.
I have written an aspx page and placed it in the _layouts directory.

I am able to access various lists and their values such as a "choice" question where the user is given a number of checkboxes to select.

I can loop through their responses: listItem("DisplayResponse").ToString() which gives me a string representation of their selections. ie the choices were as follows: 2000, 2001 and 2002 and the results if the user selected both 2000 and 2001 is as follows: ;#2000;#2001;#
However when I try to access a survey where the question is of type (Rating Scale (a matrix of choices)) "GridChoice" I am having a few problems reading the user responses.

I believe the object is of type SPFieldRatingScale and I am only able to read properties such as GridStartNumber etc,
There is a property called "Choices, however I can only access the Name of the Rating scale "question" and am unable to get the response of the user.
Dim RatingScale As SPFieldRatingScale
RatingScale = listItem.Fields("Question 1")
response.write(RatingScale.choices(0)) 'Returns Title of choice - "Rating Scale Choice #1"

I have been able to save the list as an xml file which DOES contain the responses for the user, but I would prefer to find out how to access it through the object model.

Dim doc = New XmlDocument
doc.LoadXml(listItem.Xml)
doc.Save("c:\" & listItem.ID & ".xml")

<z:row xmlns:z="#RowsetSchema" ows_ID="1" ows_Modified="2004-10-13 14:06:59" ows_Created="2004-10-13 14:06:59" ows_Author="5;#Nicole" ows_Editor="5;#Nicole" ows_owshiddenversion="1" ows_DisplayResponseNoMenu="1" ows_DisplayResponse="1" ows_InstanceID="1" ows_Order="100.000000000000" ows_Question_x0020_1="Rating Scale Choice #1;#+1#Rating Scale Choice #2;#+2#Rating Scale Choice #3;#+3#" ows_Question_x0020_2=";#2000;#2001;#" />

If anyone has had any experience with WWS and surveys please could you offer some advice,

Thanks!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top