Help, consolidating multiple view info - InfoPath Dev
in

InfoPath Dev

Help, consolidating multiple view info

Last post 06-28-2007 10:55 AM by Matt Faus. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 06-26-2007 05:15 AM

    Help, consolidating multiple view info

     

    I need  help in organizing data from multiple views.  I have about 5 views in
    my infopath form.  I would like to create a quick summary page to show all
    the information that has been entered.  i.e., view 1:  list all items.   view
    2: list all items.

    Each view has repeating section so that they may/will be filling out
    multiple items on each view.

    My question, what is the best way to consolidate all these view/repeating
    section information into quick summary page. 

    Thanks in advance.
    --
    Thanks,

  • 06-26-2007 07:12 AM In reply to

    Re: Help, consolidating multiple view info

    Hi schung,

    I'm not sure exactly what you want, but on the summary page you could use expression boxes to display sums of the rows, or maybe concatenate some of the text together into one big long string.

     It's really hard to give you advice until we know exactly what you are trying to do - can you give an example of what you have now and what you want to get?

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 06-26-2007 07:56 AM In reply to

    Re: Help, consolidating multiple view info

    Matt.

     I have multiple views in my form.  Each view has about 15 items on the drop down list & I am supposed to complete (report) about 10 items on each view. 

    Ex/ I would like to list out all the items I have selected or reporting.   

    Summary Sheet

    View 1:

    1. date, task item #1

    2. date, task item #2

    & etc

     View 2:

    1. date, task item #1

    2. date, task item #2

    & etc

    I think you get the idea (hopely)

    The summary sheet is to allow users & reviewer to look at what has accomplished by the users.

    I hope this helps.

    Schung

  • 06-26-2007 11:17 AM In reply to

    Re: Help, consolidating multiple view info

    Hi Schung,

    You should be able to accomplish this by placing the same repeating sections on the summary view, but then filtering out the rows that are displayed.  To do this, double-click on the control, go to the Display tab, and then click Filter Data.  You should add one that is something like "my:completed" IS EQUAL TO "true".

    Hope this helps!

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 06-27-2007 05:20 AM In reply to

    Re: Help, consolidating multiple view info

    Thanks, Matt.

    It worke w/o filter the data.  Thanks again.

    schung 

     

  • 06-27-2007 06:11 AM In reply to

    Re: Help, consolidating multiple view info

    Matt,

    Another question.  I have decided to use 'Repeating Table'.  It give a nice listing of all the entries in the repeating section.

     Is it possible to sort the content of the table?

    ex.

    Date    Task

    2/07

     

     

      
  • 06-27-2007 06:15 AM In reply to

    Re: Help, consolidating multiple view info

    Sorry,

    Here is full question.

    Is it possible to sort by Task in the repeating table?

    ex. (current listing)

    Date         Task

    2/07          Going shopping

    3/07          Sleeping

    Desired listing

    Date         Task

    2/07          Going shopping

    3/07          Sleeping

    4/07          Going shoping

    Desired listing

    2/07         Going shopping 

    4/07         Going shopping 

    3/07         Sleeping

     

    Thanks,

    Schung

    Re: Help, consolidating multiple view info

    Matt,

    Another question.  I have decided to use 'Repeating Table'.  It give a nice listing of all the entries in the repeating section.

     Is it possible to sort the content of the table?

    ex.

    Date    Task

    2/07

  • 06-27-2007 09:16 AM In reply to

    Re: Help, consolidating multiple view info

    Hi schung,

    Yes, this is possible, but only through code or an XSL edit.  Code is the preffered method, see this blog post for details: http://blogs.msdn.com/infopath/archive/2006/12/15/another-way-of-sorting-repeating-data.aspx

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 06-28-2007 05:52 AM In reply to

    Re: Help, consolidating multiple view info

    Thanks !!!

    Will this code method work for Infopath 2003?  The blog mentions 2007?

  • 06-28-2007 06:23 AM In reply to

    Re: Help, consolidating multiple view info

    Yes, there should be a 2003 version somewhere on the Internet.  If you have trouble finding one, let me know and I can give you the one we use.

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 06-28-2007 06:58 AM In reply to

    Re: Help, consolidating multiple view info

    Matt,

    Can you provide one for 2003?  I could not find it.

     Schung

     

  • 06-28-2007 10:55 AM In reply to

    Re: Help, consolidating multiple view info

     

        #region NodeSorter : IComparer

     

        // Reference: http://msdn2.microsoft.com/en-us/library/aw9s5t8f(VS.80).aspx

        public class NodeSorter : IComparer

        {

            // The relative XPath from the node to the element used for comparison.          

            string sXpathSortBy;

     

            // Reverse multiplier

            int iReverse = 1;

     

            // Convenience constructors

            public NodeSorter(string relativeXPath) : this(relativeXPath, false) { }

     

            // Actual constructor

            public NodeSorter(string relativeXPath, bool reverse)

            {

                sXpathSortBy = relativeXPath;

     

                if (reverse)

                    iReverse = -1;

            }

     

            /// <summary>

            /// Sorts the DOM in place.

            /// </summary>

            /// <param name="ListToBeSorted"></param>

            public void SortNodes(IXMLDOMNodeList ListToBeSorted)

            {

                if (ListToBeSorted == null)

                    throw new ArgumentException("List to be sorted must not be null.");

     

                if (ListToBeSorted.length == 0)

                    return;

     

                IXMLDOMNode nParent = ListToBeSorted[0].parentNode;

     

                IXMLDOMNode[] arNodeList = new IXMLDOMNode[ListToBeSorted.length];

     

                // Read the nodes from the NodeList into the array of nodes           

                for (int i = 0; i < ListToBeSorted.length; i++)

                {

                    arNodeList[i] = ListToBeSorted[i];

                }

     

                // reset the iterator as a convenience for whoever called this method

                ListToBeSorted.reset();

     

                // Sort the array           

                Array.Sort(arNodeList, this);

     

                // Remove all of the old, unsorted nodes

                ((IXMLDOMSelection)ListToBeSorted).removeAll();

     

                // Add the sorted nodes back in

                for (int i = 0; i < arNodeList.Length; i++)

                    nParent.appendChild(arNodeList[i]);

            }

     

            /// <summary>

            /// Sorts the nodes in place.

            /// </summary>

            /// <param name="ListToBeSorted">The list to be sorted.</param>

            /// <param name="xpath">The relative XPath to the node (underneath each child) to be used for comparison.</param>

            public static void SortNodes(IXMLDOMNodeList ListToBeSorted, string xpath)

            {

                SortNodes(ListToBeSorted, xpath, false);

            }

     

            /// <summary>

            /// Sorts the nodes in place.

            /// </summary>

            /// <param name="ListToBeSorted">The list to be sorted.</param>

            /// <param name="xpath">The relative XPath to the node (underneath each child) to be used for comparison.</param>

            /// <param name="reverse">If true, reverse the order of the sort</param>

            public static void SortNodes(IXMLDOMNodeList ListToBeSorted, string xpath, bool reverse)

            {

                NodeSorter ns = new NodeSorter(xpath, reverse);

                ns.SortNodes(ListToBeSorted);

            }

     

            int IComparer.Compare(Object left, Object right)

            {

                // This might throw an InvalidCastException,

                // but that will be up to the programmer to catch.

                IXMLDOMNode lhs = ((IXMLDOMNode)left).selectSingleNode(sXpathSortBy);

                IXMLDOMNode rhs = ((IXMLDOMNode)right).selectSingleNode(sXpathSortBy);

     

                if (lhs == null || rhs == null)

                    throw new NullReferenceException("XPath string provided resulted in a null node.");

     

                // try numeric sorting first

                try

                {

                    double dLhs = Double.Parse(lhs.text);

                    double dRhs = Double.Parse(rhs.text);

     

                    // If we reach this statement, both values are numeric                   

                    if (dLhs > dRhs)

                        return 1 * iReverse;

                    else if (dLhs < dRhs)

                        return -1 * iReverse;

                    else

                        return 0;

                }

                catch (Exception ex) { }

     

                // If we reach this statement, both values are non-numeric

                // so we will treat them as strings            

                return String.Compare(lhs.text, rhs.text) * iReverse;

            }

        }

     

        #endregion

     

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (12 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.