Imported excel and auto-sum - InfoPath Dev
in

InfoPath Dev

Imported excel and auto-sum

Last post 11-26-2008 07:41 AM by Jimmy. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 11-14-2008 02:04 AM

    Imported excel and auto-sum

    Hello All,

    I have imported on .xls file into infopath 2007. I am preparing a survey and have 100 rows of questions.

    Added one more column with drop menu for individuals to make choices. Have scores against each selection.

    Now, I want to autosum those 100 rows or those values in the last colum.

     I have seen solutions for such things, in the forum, for "repeating tables" BUT mine is NOT a repeating table. It is an imported excel file. 

     Tried taking help from the following post :

    http://www.infopathdev.com/forums/p/1075/1794.aspx#1794

    and did not work because in such a case I have to enter 100 fields whose value I need to add.

    Any help.

     Thanks

    Jags

  • 11-14-2008 10:55 PM In reply to

    Re: Imported excel and auto-sum

    Hi,

    The solution in the post http://www.infopathdev.com/forums/p/1075/1794.aspx#1794  works for repeating nodes.

    If you want to do sum for different fields, use the + operator.  For this follow the below steps.

    1. Add a field to the main data source.

    2. Go to properties of that field and click on Fx button.

    3. Click Insert a field button and then select the first field value (first field in 100 fields).

    4. Then press +, again click insert a field button and then select the second value in 100 fields.

    5. Repeat the step 4 until 100 fields are placed.

    Swathip
    www.ggktech.com
  • 11-14-2008 11:20 PM In reply to

    Re: Imported excel and auto-sum

     How is your data source structured?

     If you put all the nodes you want to sum in a group without any other elements in it, then you can get their sum with the XPath function

    sum(/my:myFields/my:groupToSum/*)

    Replacing the "my:myFields/my:groupToSum" with the actual path to the group.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 11-17-2008 11:00 PM In reply to

    Re: Imported excel and auto-sum

    Thanks a lot Jimmy.. it just worked the way I wanted..:-)

     I have another query :

    In the same excel currrently I am using 100 drop menu boxes for each row.  Is it possible that I create a secondary data source like an .xml and then point drop menu boxes to refer to .xml instead me entering the list values manually.

    Also, the important point to note here is that all drop menus should NOT get bind to each other.

     

    Thanks for your help

    Jags

  • 11-18-2008 07:23 AM In reply to

    Re: Imported excel and auto-sum

    Do your drop down lists all have the same items? In general, yes, you can create an XML file that you can use for the data connection for your drop down lists. Each list can be bound to a separate field in the form, and yet use the same XML file for the items in the list. You can either include the XML file with the form (so that it is available even when users are offline) or leave the XML file someplace all form users will have access to it, like a network share.

    Hilary Stoupa

  • 11-26-2008 06:13 AM In reply to

    Re: Imported excel and auto-sum

    thanks..but can you explain me the statement "Each list can be bound to a separate field in the form, and yet use the same XML file for the items in the list."

    my problem is that I have 100 fields in a set of 10 each. I understand that I need to create 10 different XML files if I want 10 different values for each set ( one set has 10 fields)

    I am sometimes getting the error with .XML and sometimes not able to link the .XML.

    it would be really great if you write down the simple steps for me.

    thanks for your time

    Regards

    Jags

  • 11-26-2008 07:41 AM In reply to

    All she meant was that the dropdown lists can be associated with different fields in your form and still use the same list from the XML file.

     There is no need to use 10 different XML files.  You should be able to get by with just one.  Please experiment with the attached XML file, trying the following steps.

    1. Create a new InfoPath template
    2. In Tools->Data Connections, select Add->Receive Data->XML Document, and select the XML file I provided, leaving "Include the data as a resource file..." selected.
    3. Drag a dropdown box onto your form
    4. Right click it and select "Drop-Down List Box Properties"
    5. At the middle of the Data tab, select "Look up values from an external data source"
    6. Select the data source you added in step 2.
    7. Click the button in the Entries: row and select the item node beneath set1
    8. Click the button in the Display name: row and select the display node.
    9. Go to the Data Source pane in the taskpane and drag field1 onto your form, showing it as a textbox.
    10. Repeat steps 3-9, this time with set2 and field2 instead of set1 and field1.
    11. Preview the form and observe the behavior of the two dropdown boxes.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.