How to show surveys name and responses under curret subsite by Java object model in the CEWP

Hi All,
I need to show the name of surveys, their description and all responses against the survey  under my current sub-site.
As I think there is no such out of box web-part available in SharePoint 2010.
1. Can I get it by using java script client object model and place that in CEWP?
2. Could I get code for this need?
Naimish

Sorry For late reply, I have managed to get needed out put.
Thank you Hemendra.
=====================
<script ='/_layouts/SP.js' type='text/javascript'>
ExecuteOrDelayUntilScriptLoaded(retrieveAllListProperties, "sp.js"); 
function retrieveAllListProperties() {
    var clientContext = new SP.ClientContext.get_current();;
    var oWebsite = clientContext.get_web();
    this.collList = oWebsite.get_lists();
    clientContext.load(collList);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
function onQuerySucceeded() {
    var listInfo = '';
    var str="";
    var columns = 3;
    var listEnumerator = collList.getEnumerator();
    str += '<table  style="width:1000px" border="1" cellspacing="1" cellpadding="5">'
    str += '<td style="font-size:14.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;color:red">' +  'Survey Title' + '</td>'
    str += '<td style="font-size:14.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;color:red">' + 'Survey Description' + '</td>'
    str += '<td style="font-size:14.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;color:red">' +  'Total Responses'+ '</td>'   
    while (listEnumerator.moveNext()) 
        var oList = listEnumerator.get_current();
        if(oList.get_baseType() == 4)
        {   str += '<tr>'
            //listInfo += 'Survey Title: '+oList.get_title() +'------'+' Description: '+oList.get_description() +'------'+ ' Total Responses: ' + oList.get_itemCount();
            str += '<td>' +  oList.get_title() + '</td>'
            str += '<td>' +  oList.get_description() + '</td>'
            str += '<td>' +  oList.get_itemCount() + '</td>'
            str += '<tr>'
            str += '</tr>'
    str += '</table>'   
    document.getElementById("demo").innerHTML = str;
function onQueryFailed(sender, args) {
    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
</script>
 <span id="demo" style="float:left;">Survey</span>

Similar Messages

  • How to show company name and contact name on the incoming calls of iPhone 4

    Kindly provide me with a useful solution of how to show company name and contact name on the incoming calls of iPhone4.
    even with an application or from the setting of the iPhone itself, but without telling me a solution like writting the company name in the contact name field.
    This is a very important option, i think it is a must, not an option and apple should fix this problem fastly. because it is already available in the older models of iPhone like iPhone 3G and 3GS.
    How an important feature like this could be available in old models, but in the later models is not available?

    Currently not possible without putting the company name in the contact name's field.  AFAIK, it's never been available on any iOS version.
    You might check the App Store for an app that can do this although I'm pretty sure you won't find one.
    http://www.apple.com/feedback/iphone.html

  • How to show employee names in descending order but 3rd row is fixed and always top on the table ?

    how to show employee names in descending order but 3rd row is fixed and always top on the table ?
    for example employee names is A,B,C, D, E
    and output is     C,E,D,B,A

    Since you are posting in the design forum, the short answer is - you don't.  Rows in a table have no inherent order that you can rely on and the "position" of rows is a visual characteristic that should be implemented by the application that displays
    this information or by the query that is used to generate the resultset.  
    So the next question is how one accomplishes this particular order within a select statement.  That is a tsql question which, for future reference, is best posted to the tsql forum.  In addition, many of the questions or issues that you will face
    have been discussed in the forums - often many, many times.  The first thing you should do when faced with an issue is to simply search the forums and leverage the the knowledge that has already been discussed.  In doing so you are quite likely to
    see suggestions or related issues that you should consider in your search for a solution.  
    Now, to answer the question - you need to formulate a order by clause that forces the rows to be sorted in the manner you desire.  Effectively you have 2 levels of sorting.  The first level divides your rows into 2 groups.  Group 1 consists
    of rows where name = E and Group 2 is everything else.  Following that you then need to sort the rows in each group by name in descending order.  Something like:  
    order by case name when E then 1 else 2 end, name desc

  • How to show rating dots and file name underneath thumbnail in Bridge CS4 preview workspace?

    How to show rating dots and file name underneath thumbnail in Bridge CS4 preview workspace?

    Thank you! That was it. The option to change it is not available in preferences (though I believe it was in early CS versions). It's hidden in a dropdown menu associated with an icon at the top. It sure wasn't easy to find, and I probably would not have done so without your lead. Thanks again!

  • I can't get my Ipad to show up at all in Itunes.  1 How do I fix that and 2 Can I fix this without losing all of the videos and apps that aren't synched with my computer yet?

    I can't get my Ipad to show up at all in Itunes.  1 How do I fix that and 2 Can I fix this without losing all of the videos and apps that aren't synched with my computer yet?

    http://support.apple.com/kb/ts1591
    http://support.apple.com/kb/TS1538

  • How to pass login name and password

    Hi all,
    If this question has been asked before, please let me know, and I am sorry for duplicate the question raising.
    I want to use the login name and password which are entered from the left frame(topic frame) in the right frame ( the content frame).
    I have 3 jsp programs, "A.jsp" is for validate the login (name and password), "B.jsp" contains a form-submit to add the records to a database. "C.jsp" is the actual one which does the updating to the database.
    Q1, how can I re-use the login name and password for "B.jsp" and "C.jsp"?
    Q2, is there any security problem to do so?
    your useful reply will give me a great help.
    ths

    or try here:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=308840
    http://forum.java.sun.com/thread.jsp?forum=31&thread=295349

  • How to pass user name and password in openConnection method ?

    Hi, Exports,
              I am trying to post data from applet to another application which is
              protected by network password.
              How to pass user name and password when I use openConnection method? In java
              doc, this method looks like do not accept these two parameters.
              Thanks
              ----- my code in applet ---------
              URL url = new URL("http://127.0.0.1/xml/index.cfm");
              URLConnection connection = url.openConnection();
              connection.setDoInput(true);
              connection.setDoOutput(true);
              connection.setUseCaches(false);
              connection.setAllowUserInteraction(false);
              DataOutputStream dos = new DataOutputStream(connection.getOutputStream());
              dos.writeBytes("POST " + path + " HTTP/1.0\r\n");
              dos.writeBytes("Referer: http://127.0.0.1/XML/index.cfm\r\n");
              dos.writeBytes("Content-Type:
              multipart/form-data;boundary=---------------------------7d0b414b04\r\n");
              dos.writeBytes("Host: "+host+":"+port+"\r\n");
              dos.writeBytes("Content-Length:" + buff.length()+"\r\n");
              dos.writeBytes("Connection: Keep-Alive\r\n\n");
              dos.writeBytes("-----------------------------7d0b414b04\r\nContent-Dispositi
              on: form-data;name=\"xmlDoc\"\r\n\r\n");
              dos.writeBytes(buff.toString());
              dos.writeBytes("\r\n-----------------------------7d0b414b04--\r\n");
              dos.close();
              

    you need to negotiate Authentication in ur applet code...
              For example:
              If u r using Form based auth u need to send Post a request with j_user_name &
              j_password to the action j_security_check. and when server returns back the
              cookie
              u need to hold it and pass that cookie to the each and every request made to the
              protected application.
              Basically u need to imitate the browser.
              regards
              aseem
              David wrote:
              > Hi, Exports,
              >
              > I am trying to post data from applet to another application which is
              > protected by network password.
              > How to pass user name and password when I use openConnection method? In java
              > doc, this method looks like do not accept these two parameters.
              >
              > Thanks
              >
              > ----- my code in applet ---------
              > URL url = new URL("http://127.0.0.1/xml/index.cfm");
              > URLConnection connection = url.openConnection();
              > connection.setDoInput(true);
              > connection.setDoOutput(true);
              > connection.setUseCaches(false);
              > connection.setAllowUserInteraction(false);
              > DataOutputStream dos = new DataOutputStream(connection.getOutputStream());
              > dos.writeBytes("POST " + path + " HTTP/1.0\r\n");
              > dos.writeBytes("Referer: http://127.0.0.1/XML/index.cfm\r\n");
              > dos.writeBytes("Content-Type:
              > multipart/form-data;boundary=---------------------------7d0b414b04\r\n");
              > dos.writeBytes("Host: "+host+":"+port+"\r\n");
              > dos.writeBytes("Content-Length:" + buff.length()+"\r\n");
              > dos.writeBytes("Connection: Keep-Alive\r\n\n");
              > dos.writeBytes("-----------------------------7d0b414b04\r\nContent-Dispositi
              > on: form-data;name=\"xmlDoc\"\r\n\r\n");
              > dos.writeBytes(buff.toString());
              > dos.writeBytes("\r\n-----------------------------7d0b414b04--\r\n");
              > dos.close();
              >
              > ------------------------------------------
              

  • How to fetch APPROVER NAME  and approval date dynamically for an user

    Hi all..
    How to fetch approver name and approval date dynamicall for an user in an email template..
    can any help me to sort out this pbm,i am new to IDM..
    Thanks in advance..

    Access policies get a static value.  You can't populate a field with an adapter.  If you must do this, leave the field blank, and put an adapter on the process form for your field that must be populated using code or logic.
    -Kevin

  • How to validate user name and password in webdynpro.

    Dear All,
    Actually i have created login name and password in view, webdynpro and want to validate the user name and password but  i am not finding proper code to  how to validate user name and password.
    Pl do the needful help.
    Regards.
    Tazeer.
    Moderator Message: There is a seperate forum for WebDynpro. Please ask your question there.
    Edited by: kishan P on Oct 5, 2010 1:08 PM

    Hello, I don´t get you question. User authentication is ready out of the box in webdypro...
    Regards Otto

  • How do remap drive names and not lose project clip links to Event names...?

    how do remap drive names and not lose project clip links to Event names...?

    You will need an extra external drive. All moves must be done within iMovie to preserve your links to the projects.
    First Move (command-drag) the event to the extra drive. Make sure the project still works.
    Then rename, reformat, or repartition your drive as needed. Then, if you want, move the Event back to the newly named drive, again via Command-Drag within iMovie.

  • Show user name and IP address

    Hi All,
    When we upload or create contents or post the messages in the discussion. The user name will be recorded.  Is there any ways to record and show both name and IP address of user?
    Thanks,
    Anucha

    Hi Anucha,
       Perhaps, I am not understanding your requirement. To upload a file, for instance, you must be connected to the portal, therefore you know who uploaded these documents.
       Could you give me more information about your necessity ?
    Patricio.

  • How to Concatenate Table name and Where condition at runtime

    I am passing parameter as User and Zone to Stored Procedure.How to concatenate Table Name
    and WHERE CONDITION in SQL Statement.i have different type of users and zones.

    Hi !
    declare
      cur sys_refcursor;
      r emp%rowtype;
      v_sql varchar2(512);
    begin
    -- do your logic here
      v_sql := 'select * from emp';
      open cur for v_sql;
      loop
        fetch cur into r;
        exit when cur%notfound;
        dbms_output.put_line(r.ename);
      end loop;
      close cur;
    end;In this example you can see how can be done this with cursor vars .. You should concatenate v_sql string according to your requirements.
    But as in further posts has already been mentioned , be carefull at publishing such kind of procedures and think on security.
    Also when you want dynamicaly change from clause , you should consider using different records to accept data ? Maybe all your tables has the same structure and then this problem will be smaller.
    T
    T

  • How do I change name and install Password or pass code

    How do I change name and install Password or pass code?

    You would do this using the AirPort Utility.
    To change the Network Name using AirPort Utility v6.x: AirPort Utility > Select your AirPort > Edit > Wireless tab > Wireless Network Name. On the same tab, you can set the wireless security password.

  • How to create new country and cities under country?

    hello,
    i am using 11.5.5 apps version,
    want to create new country and cities under that country, please tell me what is the procedure for that.
    i am using demo vis:
    operations as user.
    Thanks
    yash

    Hi,
    Please check below notes which could be helpful for your issue
    How to Add a New Legal Entity, Ledger and Operating Unit for a New Country [ID 1064366.1]
    How To Create New Countries In The Regions And Zones Form [ID 739798.1]
    How To Enter New Countries or Territories Into The FND_TERRITORIES Table? [ID 341032.1]
    How To Add New Legal Entity Registration Code For Countries That Are Not Available In The List? [ID 604280.1]
    Regard
    Helios

  • How to suffix user name and password remote pc in shutdown /s command

    Hi,
    We can shutdown a remote pc  using " shutdown /s /m \\ipaddress " command, only if password of remote pc is stored in windows credential  manager.
    But how to  add user name and password when i execute the command for example : when we map a share folder on our pc we use below command with  user name and password
    "net use * \\ipaddress\share password /user:username "
    can we give user name and password of remote pc  while we give shutdown command to turn off  a remote pc (without adding user name and password to windows credentials).
    Thanks in advance..........

    Hello Jayanth kundar,
    Based on my test, I can use the command shutdown /s /m \\10.157.21.77 to shutdown the remote computer when the have the same username and password.
    Do you mean that you want to add user name and password when you want to shutdown the remote computer?
    I can't find a user name and password in Windows Credential Manager, please share us a screenshot.
    Best regards,
    Fangzhou CHEN
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

Maybe you are looking for

  • Print control in Smart forms?

    Dear All: I have a question in my SMARTFORM page development that i want to calling the smartform many times in my program. 1.IN R/3 RELEASE VERSION: 4.7, it can call Function module--> SSF_OPEN and SSF_CLOSE using parameters of control_parameters  t

  • Mountain Lion Internet only available through Chrome

    I have a 17-inch, early 2009 MacBook Pro. 2.66 GHz Intel Core 2 Duo. After installing Mountain Lion everything was working fine for a couple of days, then suddenly I could no longer access the internet through Safari. At the same time Mail stopped co

  • SAPehp tool does not know the host for Java stack

    I  am running SAPehp tool to apply enhp2 to a dual stack with ABAP and JAVA on seperated Windows boxes. I started SAPehp at the ABAP box. Because there is no way to tell where is the Java host, how do I apply the enhp2 to the Java side? How to make A

  • Creative Suite CS2 InDesign Freeze Up During PDF Export

    Help anyone? Why does my InDesign CS2 sometimes freeze up when I am trying to export to a pdf? I then have to do a 'Force Quit' and retry. When I am trying to make a pdf in InDesign, I select >File >Export and export to pdf with 'press high res' sett

  • How to calculate counts from different dates into 1 date

    Hi, I have a scenario below ID Type Country Date 123AP1 P US 1/1/2009 123A1 A WO 4/4/2010 123A2 A US 6/6/2011 123A3 A US 8/8/2011 So, the logic I need to display is - If, Type = P AND Country=US then count 1 where ID has 123AP1 else If Type = A AND C