sorting a repeating table with qRules... problem - InfoPath Dev
in

InfoPath Dev

sorting a repeating table with qRules... problem

Last post 07-09-2009 09:56 AM by harp71. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-07-2009 12:54 PM

    sorting a repeating table with qRules... problem

    Hey I have a repeating table on my form that I would like to sort... everytime I try I get this error:

    Action: SortTable
     Arguments: System.Collections.Generic.Dictionary`2[System.String,System.String]
     Details: Schema validation found non-data type errors.
    Stack:   at Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlDocument.ThrowExceptionFromMsxmlInteropError(MsxmlInteropError eError)
       at Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlDocument.ThrowExceptionFromHresult(Int32 hrError)
       at Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlNodeImpl.AppendChild(String strXml)
       at Microsoft.Office.InfoPath.MsxmlWriter.Close()
       at System.Xml.XmlWellFormedWriter.Close()
       at System.Xml.XPath.XPathNavigator.AppendChild(XmlReader newChild)
       at System.Xml.XPath.XPathNavigator.AppendChild(XPathNavigator newChild)
       at Qdabra.Tools.RulesLibrary.Commands.SortTable(String domName, String rowXPath, String fieldXPathList, String orderList, String typeList)
       at Qdabra.Tools.RulesLibrary.Commands.SortTable()
       at Qdabra.Tools.RulesLibrary.Commands.ExecuteCommand(Application application, XmlFormHostItem formHost, XPathNavigator commandsNavigator)

    My sort is below and is triggered by option buttons byDate, byGroup

    ByGroup SortTable /row=my:myFields/my:Accomplishments /compare=my:GroupBy,my:EstimatedCompletionDate /order=ASC,ASC /type=text,text

    ByDate SortTable /row=my:myFields/my:Accomplishments /compare=my:EstimatedCompletionDate,my:GroupBy /order=ASC,ASC /type=text,text

    I have even tried just sorting one field rather than two and still get this error...

     Any thoughts on this?

     

  • 07-07-2009 01:08 PM In reply to

    Re: sorting a repeating table with qRules... problem

    Can you attach your template so we can take a look at it?

    When you reply to this post, under Options there is a place to add a file....

    Hilary Stoupa

  • 07-07-2009 01:23 PM In reply to

    Re: sorting a repeating table with qRules... problem

    Here it is... I have reduced this form down to just the offending section along with the Conditional Formatting and Rules that are trying to be applied...

    Conditional formatting works like a champ...

    Rules I cannot make work either in the Repeating Table or off of the Option buttons...

    Thanks!

     

    Just noticed the original form was missing an option button... fixed and here it is again...

  • 07-07-2009 02:32 PM In reply to

    Re: sorting a repeating table with qRules... problem

    Your syntax seems correct. When I add a new repeating group with fields like those in your current template, everything works. I've looked at the form source files to see if I can track down what is causing the error, and don't see anything....

    I'm going to ask some other members of the team to take a look and see if they see what might be causing this error.

    Hilary Stoupa

  • 07-07-2009 03:23 PM In reply to

    Re: sorting a repeating table with qRules... problem

    I did a little research into your issue and found what is causing it and a workaround for you.

    The SortTable command is trying to append the rows to the table. The table is being determinded by the row you specify in the command, and then up one level. In your case, the table becomes my:myFields.

    When the rows are sorted, they are appended into the table. This is where the problem occurs because your rows are NOT the bottom-most nodes of the DOM. The command currently is not able to put the rows back into the middle of the DOM tree (which is where they are currently located). This is an issue we have logged and will look at fixing in a future release.

    In the meantime, there are two workarounds:

    1. Move your repeating table into a container group. This is the best option as it componentizes your table and the structure has some advantages in InfoPath. The new structure would look like:

    my:myFields/my:Accomplishments/my:Accomplishment

    where Accomplishments is a group and Accomplishment is the individual repeating row.

    2. Locate your table at the end of your schema. This is not a good option because your schema might later change and you would have to always ensure it stays at the end. Plus if you ever have another table to sort, you run into the same issue for that one.

    We encourage you to choose workaround 1 above as it follows best practices for schema design.

  • 07-09-2009 09:56 AM In reply to

    Re: sorting a repeating table with qRules... problem

    That did the trick!

    Many Thanks!

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