Stump the Panel: SharePoint Q&A

Immediate solutions for common SharePoint questions
It is currently Fri Dec 19, 2014 3:53 am

All times are UTC - 5 hours [ DST ]


Forum rules


What you are viewing is an archive of Stump the Panel. It remains for reference purposes. Please post all new questions on NothingButSharePoint.com
https://www.nothingbutsharepoint.com/sites/eusp/Forum



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: WSS Survey Summary View
PostPosted: Mon Mar 28, 2011 6:58 pm 
Offline

Joined: Sat May 22, 2010 8:14 pm
Posts: 29
Hello All,

Is there a way to modify the survey graphical summary view to remove sections not required.
We are happy with the way the survey works.

Regards Michael


Top
 Profile  
 
 Post subject: Re: WSS Survey Summary View
PostPosted: Tue Mar 29, 2011 8:36 am 
Offline
User avatar

Joined: Mon Jan 04, 2010 12:35 pm
Posts: 364
Dear Michael,

Yes, you should be able to do that easily with jQuery.

The HTML is pretty straightforward on this page, with one question/summary section looking something like the following:

Code:
. . .
<H3 class="ms-standardheader, ms-vb"><B>22. Did you receive medical attention?</B></H3>
<TABLE border=0 cellSpacing=0 cellPadding=0><TBODY>
    <TR><TD style="HEIGHT: 3.75pt"></TD></TR>
    <TR>
        <TD style="WIDTH: 1pt; PADDING-RIGHT: 17pt; FONT-SIZE: 0.01em">&nbsp;</TD>
        <TD style="PADDING-BOTTOM: 5px" class=ms-vb>Yes</TD></TR>
    <TR>
        <TD></TD>
        <TD align=left>
            <TABLE style="WIDTH: 375pt" border=0 cellSpacing=0 cellPadding=0><TBODY>
                <TR>
                    <TD style="WIDTH: 5pt; FONT-SIZE: 0.01em" class=ms-surveyHBarLabel>&nbsp;</TD>
                    <TD style="WIDTH: 70pt" class=ms-SurveyHBarLabel><LABEL class=ms-hidden>Number Of Responses</LABEL>1&nbsp;<LABEL class=ms-hidden>Percentage Of Responses</LABEL>(33%)&nbsp;</TD>
                    <TD style="HEIGHT: 11pt" class=ms-surveyHBarB>
                        <TABLE border=0 cellSpacing=0 cellPadding=0 width="33%" height="100%"><TBODY>
                            <TR><TD class=ms-surveyHBar>&nbsp;</TD></TR>
                        </TBODY></TABLE>
                    </TD>
                </TR>
            </TBODY></TABLE>
        </TD>
    </TR>
    <TR><TD style="HEIGHT: 7.5pt"></TD></TR>
    <TR>
        <TD style="WIDTH: 1pt; PADDING-RIGHT: 17pt; FONT-SIZE: 0.01em">&nbsp;</TD>
        <TD style="PADDING-BOTTOM: 5px" class=ms-vb>No</TD></TR>
    <TR>
        <TD></TD>
        <TD align=left>
            <TABLE style="WIDTH: 375pt" border=0 cellSpacing=0 cellPadding=0><TBODY>
                <TR>
                    <TD style="WIDTH: 5pt; FONT-SIZE: 0.01em" class=ms-surveyHBarLabel>&nbsp;</TD>
                    <TD style="WIDTH: 70pt" class=ms-SurveyHBarLabel><LABEL class=ms-hidden>Number Of Responses</LABEL>2&nbsp;<LABEL class=ms-hidden>Percentage Of Responses</LABEL>(67%)&nbsp;</TD>
                    <TD style="HEIGHT: 11pt" class=ms-surveyHBarB>
                        <TABLE border=0 cellSpacing=0 cellPadding=0 width="66%" height="100%"><TBODY>
                            <TR><TD class=ms-surveyHBar>&nbsp;</TD></TR>
                        </TBODY></TABLE>
                    </TD>
                </TR>
            </TBODY></TABLE>
        </TD>
    </TR>
    <TR>
        <TD></TD>
        <TD vAlign=top colSpan=3>
            <HR class=ms-surveyHR SIZE=1>
            <DIV class=ms-surveyTotal>Total: 3</DIV>
        </TD>
    </TR>
</TBODY></TABLE>
. . .


To hide the above information, I would add a CEWP to the Graphical Summary page and include the following jQuery:

Code:
   $(document).ready( function() {
       $('h3:contains("22. Did you receive medical attention?")').hide().next("table").hide();
   })


Caveat: If you remove this one from the midst of your survey, the other numbers will stay the same and leave a gap where 22 should be. You could add a couple of more lines to change it all to an ordered list, so that it would renumber itself.

Blessings,
Jim Bob


Top
 Profile  
 
 Post subject: Re: WSS Survey Summary View
PostPosted: Tue Mar 29, 2011 5:04 pm 
Offline

Joined: Sat May 22, 2010 8:14 pm
Posts: 29
Hello Jim Bob,

I put the code you suggested in the source editor and changed it to remove question 1. All I got was the code displaying at the top of the page.
Do I need to put the code in the source editor? and do i need to have the Jquery library as well?
Have included the code for the Summary.ASPX. I want to remove or hide the first and last questions.

Regards Michael

Code:
<%@ Page language="C#" MasterPageFile="~masterurl/default.master"    Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
   <SharePoint:ListProperty Property="Title" runat="server"/></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
   <SharePoint:ListProperty Property="Title" runat="server"/>
</asp:Content>
<asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
   <SharePoint:RssLink runat="server"/>
</asp:content>
<asp:Content ContentPlaceHolderId="PlaceHolderSearchArea" runat="server">
   <SharePoint:DelegateControl runat="server"
      ControlId="SmallSearchInputBox"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server">
   <SharePoint:ViewIcon Width="145" Height="54" runat="server"/></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderLeftActions" runat="server">
<SharePoint:ModifySettingsLink runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId ="PlaceHolderBodyLeftBorder" runat="server">
   <div height=100% class="ms-pagemargin"><IMG SRC="/_layouts/images/blank.gif" width=6 height=1 alt=""></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
      <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate>
<WebPartPages:ListViewWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{B07BD764-DCF7-4736-A350-339F990F4D88}" >
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
  <Title>Customer Satisfaction</Title>
  <FrameType>Default</FrameType>
  <Description />
  <IsIncluded>true</IsIncluded>
  <PartOrder>1</PartOrder>
  <FrameState>Normal</FrameState>
  <Height />
  <Width />
  <AllowRemove>true</AllowRemove>
  <AllowZoneChange>true</AllowZoneChange>
  <AllowMinimize>true</AllowMinimize>
  <AllowConnect>true</AllowConnect>
  <AllowEdit>true</AllowEdit>
  <AllowHide>true</AllowHide>
  <IsVisible>true</IsVisible>
  <DetailLink>/Lists/Customer Satisfaction/overview.aspx</DetailLink>
  <HelpLink />
  <HelpMode>Modeless</HelpMode>
  <Dir>Default</Dir>
  <PartImageSmall />
  <MissingAssembly>Cannot import this Web Part.</MissingAssembly>
  <PartImageLarge />
  <IsIncludedFilter />
  <ExportControlledProperties>false</ExportControlledProperties>
  <ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>
  <ID>g_b07bd764_dcf7_4736_a350_339f990f4d88</ID>
  <ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">{DB468AB4-5961-43DE-84F3-779F5DE3BF4C}</ListName>
  <WebId xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">00000000-0000-0000-0000-000000000000</WebId>
  <ListViewXml xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">&lt;View Name="{B07BD764-DCF7-4736-A350-339F990F4D88}" Type="CHART" ReadOnly="TRUE" FreeForm="TRUE" DisplayName="Graphical Summary" Url="/Lists/Customer Satisfaction/summary.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/survey.png"&gt;&lt;ViewFields&gt;&lt;FieldRef Name="Comments"/&gt;&lt;FieldRef Name="Referrals"/&gt;&lt;FieldRef Name="Job_x0020_Number"/&gt;&lt;FieldRef Name="Overall_x0020_Experience_x0020_w0"/&gt;&lt;/ViewFields&gt;&lt;Toolbar Type="Standard"/&gt;&lt;/View&gt;</ListViewXml>
  <ViewFlag xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">131233</ViewFlag>
  <ViewContentTypeId xmlns="http://schemas.microsoft.com/WebPart/v2/ListView">0x</ViewContentTypeId>
</WebPart>
</WebPartPages:ListViewWebPart>
</ZoneTemplate></WebPartPages:WebPartZone>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderBodyAreaClass" runat="server">
<style type="text/css">
.ms-bodyareaframe {
   padding: 0px;
}
</style>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageDescription" runat="server">
<SharePoint:ListProperty CssClass="ms-listdescription" Property="Description" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderCalendarNavigator" runat="server">
      <SharePoint:SPCalendarNavigator id="CalendarNavigatorId" runat="server"/>
</asp:Content>


Top
 Profile  
 
 Post subject: Re: WSS Survey Summary View
PostPosted: Tue Mar 29, 2011 5:20 pm 
Offline
User avatar

Joined: Mon Jan 04, 2010 12:35 pm
Posts: 364
Yes, you'll need the jQuery library.

Please see the link I provided to Marc Anderson's article on adding a CEWP to the page for using jQuery:
http://sympmarc.com/2011/03/26/adding-script-into-a-content-editor-web-part-cewp-in-sharepoint-2007/

That'll walk you through getting jQuery on the page, then include the code I provided where appropriate.

If Marc's article isn't clear, let me know and I'll walk you through it. ;)

Blessings,
Jim Bob


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group