2 Issues with margins and with ampersands. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

2 Issues with margins and with ampersands.

Last post 12-13-2011 12:00 PM by Jtcom. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 12-13-2011 10:39 AM

    • Jtcom
    • Top 500 Contributor
    • Joined on 06-16-2011
    • Posts 34

    2 Issues with margins and with ampersands.

    I have two issues that I am running into while creating forms in InfoPath and I am trying to find out if these are known issues caused by InfoPath or if their root source is in another program.

     

    The first and, seemingly, simpler issue is that I have noticed that the amount of data that will fit on a single page in InfoPath 2007 seems to be less than the amount of data that will fit on a single page of Word 2007.  Even when I convert a 2 page word document into a form it then takes 3 pages and will not all fit properly.  Going in and changing the margins on the InfoPath form helps some, but it generally still takes some fiddling with row size and font sizes to make it the same page length as the form was in word.  Anyone know what the difference is and how I can counter it without spending a lot of time manually changing the form layout? (Due to the nature of the forms I have to match the original very closely in most cases)

     Second issue, I am creating a form that pulls data from a SQL2008 database using the DBXL web service and query builder and am encountering an error when I try to pull data into the form that contains an ampersand.  The form pulls a list of about 15000 business names and allows the user to select them, and then the addresses that are valid for a given business, from 2 dropdown lists, that all works fine, for the most part.  The issue occurs if a user attempts to select a business name that contains an ampersand, at that point an error comes up that says “Some rules were not applied” and has the error text I included at the end of this post.  Can anyone tell me if this is an issue with DBXL and its data retrieval, or might this be coming from somewhere else? Thank you for any thoughts or ideas,JError: The query cannot be run for the following DataObject: OrganizationLocationAdressMergedInfoPath cannot run the specified query.The SOAP response indicates that an error occurred on the server: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentException: Invalid parameterParameter name: queryXml ---> System.Xml.XmlException: An error occurred while parsing EntityName. Line 1, position 192.   at System.Xml.XmlTextReaderImpl.Throw(Exception e)   at System.Xml.XmlTextReaderImpl.ParseEntityName()   at System.Xml.XmlTextReaderImpl.ParseEntityReference()   at System.Xml.XmlTextReaderImpl.Read()   at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)   at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)   at System.Xml.XmlDocument.Load(XmlReader reader)   at System.Xml.XmlDocument.LoadXml(String xml)   at Qdabra.QueryDB.QueryDBService.Qdabra.QueryDB.Services.IQueryDBService.GetColumnsXMLStrQuery(String queryXml)   --- End of inner exception stack trace ---   at Qdabra.QueryDB.QueryDBService.Qdabra.QueryDB.Services.IQueryDBService.GetColumnsXMLStrQuery(String queryXml)   --- End of inner exception stack trace ---

     

  • 12-13-2011 10:49 AM In reply to

    Re: 2 Issues with margins and with ampersands.

    Hello Jtcom,

     Could you post the formula you're using the for the query that's generating that error?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-13-2011 11:01 AM In reply to

    • Jtcom
    • Top 500 Contributor
    • Joined on 06-16-2011
    • Posts 34

    Re: 2 Issues with margins and with ampersands.

    There may be two different ones that might be causing it as I learned from a prior form to create a separate data connection to populate my drop down lists from, in addition to the connection that is being used for the filtered query.

     

    The Query XML from the query builder for the drop down connection is:

    <query database='clientdata' table='vwOrganizationLocationWithAddress' maxrows='2' getSample='true'><columns><column name='OrgName'/></columns></query> The Query XML from the other connection that is linked to the form and set up to filter data is:<query database='clientdata' table='vwOrganizationLocationWithAddress' maxrows='2' getSample='true'><columns><column name='OrgName'/><column name='Address'/></columns></query> Is that what you needed?

     

  • 12-13-2011 11:23 AM In reply to

    Re: 2 Issues with margins and with ampersands.

    Those are the queries for setting up the data connections, but what are the actual query formulas that you're using in your rules?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-13-2011 11:27 AM In reply to

    • Jtcom
    • Top 500 Contributor
    • Joined on 06-16-2011
    • Posts 34

    Re: 2 Issues with margins and with ampersands.

    Sorry should have included this as well the first time.  Someone created a view for me to use with the form so only 1 query formula and here it is:

     

    concat("<query database='clientdata' table='vwOrganizationLocationWithAddress'><columns><column name='OrgName'/><column name='Address'/></columns><filter><and><eq><column name='OrgName'/><value>", xdXDocument:get-DOM()/my:myFields/my:OrgNameDropDownList ,"</value></eq></and></filter></query>")

  • 12-13-2011 11:33 AM In reply to

    Re: 2 Issues with margins and with ampersands.

    Could you give this a try: 

    concat("<query database='clientdata' table='vwOrganizationLocationWithAddress'><columns><column name='OrgName'/><column name='Address'/></columns><filter><and><eq><column name='OrgName'/><value><![CDATA[", xdXDocument:get-DOM()/my:myFields/my:OrgNameDropDownList ,"]]></value></eq></and></filter></query>")

    I put <![CDATA[ and ]]> before and after the place where the field value is added, and that should prevent ampersands from causing any issue.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-13-2011 12:00 PM In reply to

    • Jtcom
    • Top 500 Contributor
    • Joined on 06-16-2011
    • Posts 34

    Re: 2 Issues with margins and with ampersands.

    Yes that works now.  Thank you very much, I am totally out of my element when I get into modifying the info the query builder gives me so I never would have figured that out.
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.