Sort data connections - InfoPath Dev
in

InfoPath Dev

Sort data connections

Last post 12-15-2008 11:28 PM by Shiva. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-07-2007 11:42 AM

    Sort data connections

    I'm trying to figure out how to sort a secondary data connection to a sharepoint list. I'm aware that the sort on the view dictates the sort in the connection but I've read in these forums it can be changed using code. I think I have to use addsort but am not sure on how it works. I've tried this but it's not working.

     The node selected in the expression is a dropdown box filled by a secondary data source


                Dim expr As XPathExpression
                expr = thisXDocument.DOM.selectSingleNode("//my:myFields/my:ProcessInfo/my:FilterMaterial")
                expr.AddSort("FilterMaterial", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Text)
                MsgBox("test", MsgBoxStyle.Critical)

    Any help in the right direction would be greatly appreciated. Thanks!

     

    Shaun Nieves
    Sharepoint Manager
  • 08-09-2007 09:27 AM In reply to

    Hi Shaun,

    Great question. There is sorting functionality for XML included in the Asset Tracking sample that ships with InfoPath 2003 (open in Designer, File->Save as Source, search for sort in the script.js file). It shows how to sort XML child nodes using an index and then rebuild the XML in one full swoop. Assuming you do that OnLoad the secondary data source, which is just XML, will show sorted. You will likely need to create a separate XML DOM to stream the child nodes into using the sorted indexes. Unfortuantely, the Asset Tracking example is javascript, but you should be able to get the technique. .NET as the same quick sort function.

    I'd be happy to help further on this, but see what you can make of the Asset Tracking code first.

    Cheers!

    Patrick Halstead
    Project Manager at Qdabra
  • 12-15-2008 08:48 AM In reply to

    Is there any way to sort a secondary data source in Browser Enabled form? I have a form with mulitple views, and in order to create a preserve code block I have to go and edit all XSL sheets that correspond that form. I'm populating a dropdown menu from a SharePoint List, in the thick client (Info Path) the form appears and renders the sort order that is being used from my SharePoint view. I've have created a preserve code block, but that feature is not supported in a browser enabled form.

  • 12-15-2008 11:28 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Hello,

    Here is the link related to sort,

    http://www.infopathdev.com/forums/t/4733.aspx

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.