Very strange behavior on repeating table values - HELP! - InfoPath Dev
in

InfoPath Dev

Very strange behavior on repeating table values - HELP!

Last post 04-22-2010 01:09 PM by oldradio99. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-21-2010 11:05 AM

    Very strange behavior on repeating table values - HELP!

     I was having a major challenge with a form I was developing.  There is no special code.  Everything is done with point and click.

    To isolate the issue, I created a simple SQL table shown below.  Basically 4 fields

    I then created a simple repeating table linked to the database connection.

    Field1 is the only field in te repeating table.

    The other three fields are form fields in the table footer and I have label them how they are set up.

    I used the form fields to set the default value for fields2,3 & 4 in the database.

    As you can see in the first example, the total field gives a very weird result.

    Under the table I just dragged the database fields so you can see the values that are getting populated.

     

    The error on the data line just says Invalid data.

    Now in the next example, I did not use 100.01 but 100.50.  No form error.

    I gett he error and very stange result when the decimal value is under .50 

     I have tried every combination of formating the fields from numbers to currentcy with no effect.

    So now my question comes to is this a bug in InfoPath and how do I get around it?

    I hope I have described everything adequately but if anot ask away.

    Thank you

    Thank you for your Help.

    Art
  • 04-22-2010 12:37 AM In reply to

    Re: Very strange behavior on repeating table values - HELP!

    set datatype of total field  to decimal(double) type.

    right click total field -> set data type  to decimal (double)

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 04-22-2010 08:15 AM In reply to

    Re: Very strange behavior on repeating table values - HELP!

    setting the fields to double decimal has no effect other than showing the value as .01 but the actual data is the .009999999999999

     

    Qazi Anis:

    set datatype of total field  to decimal(double) type.

    right click total field -> set data type  to decimal (double)

     

    Thank you for your Help.

    Art
  • 04-22-2010 12:50 PM In reply to

    Re: Very strange behavior on repeating table values - HELP!

    I took another step today with the same strange results.

    I created a form not bound to any data source. Filed1 became a repeating field.  Field2 was set as sum field1.  Field3 was a text box and Field4 was set as Field2 minus Field3.

    Entering two repeating rows with values of 100 and .01 and then entering 100 in field3 yields a result in field4 of -0.009999999999990905.  The result should be .01.

    If the .01 value is set to anything under .50 the results are wrong.  .50 and over work fine.

    All fields are set as double decimal.

    is this a math bug in InfoPath?

    Help please.  I am out of ideas.

     

     

     

    Thank you for your Help.

    Art
  • 04-22-2010 01:09 PM In reply to

    Re: Very strange behavior on repeating table values - HELP!

    I finally found the solution. 

     

    It is at the end of this article  http://blogs.msdn.com/infopath/archive/2008/04/17/invalid-data-error-when-calculating-the-result-of-2-or-more-fields.aspx

    It has to do with something called IEEE Floating-Point Errors.

     

    Thank you for your Help.

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