in

InfoPath Dev

retitled : Node Type in c#

Last post 06-20-2008 09:14 PM by Hilary Stoupa. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 05-27-2008 07:09 AM

    retitled : Node Type in c#

    Hello everyone,

     The title explain the reason of my post, despite I've browse dozen of topics speaking about it. Saying all the same thing, it don't work in my french infopath.

    Context :
    I made a repeating table linked to a sharepoint form library where i got number in a column.(numbers are extracted from forms)
    The display of the table is proper, meaning I still see the result of my SP List if no sum test, but no way i can sum those numbers.
    Infopath won't open when i use the french equivalent to

    sum(eval(repeating group, 'field_to_sum'))

    and if I change syntax, formulae is not supported.

    I guess It's something with the second data source ...


    Anyone who can see where can be my mistake ?

    Best regards,

     

  • 05-27-2008 07:43 AM In reply to

    Re: Sum Repeating Table - second data source - crash

    Is it a text field in SP or a number?

    What does the field type come into InfoPath as? What does it refer to it as in your data source and properties?

    Why are you using eval? Have you tried just summing the field itself without the eval?

  • 05-27-2008 07:56 AM In reply to

    retitled : Node Type in c#

    I think it's a textfield, I promote colomn, but I couldn't change type.

    If I select my second data source, field type is a string too. But I read sum() can convert types ..

    Yest I have tried to sum just the field but got a 'NaN'. Someone show me that it was possible with a secondary source, and that sum(column) will do the job, but still :( not with me ..

    I'm using eval, because I read topics about 'repeating table sum etc.' and they all used that, because this is in a 'repeating context' I guess. I'm wrong about that part ? :/

  • 05-27-2008 09:20 AM In reply to

    Re: Sum Repeating Table - second data source - crash

    Have you listed all of the data to verify there are values and they are numeric?

    I would maybe go back to the original form the value is coming from and try to set it to a numeric value so that you do not have the string conversion issue. Or add another numeric field which defaults from the value of the text field and then sum that.

  • 05-27-2008 11:54 PM In reply to

    retitled : Node Type in c#

    This is it.

    Despite, I'm very surprised, because I see many examples where it was done with 'string'. Maybe It was because I manage to calculate the number with code, I didnt notice it was so important, reading everywhere sum doesnt care for typo. And someone show me eval() was not usefull.

    Well now I know that NaN Value are usually a format error. And Tutorial are 'as is'

    Thanks for your help.

     

    edit : my main problem cames from the fact I tested the sum (forms) with decimal number (needed to transform half-days in 0,5, when I change the field type in double, the code I used need to insert strings in the node, I got a new prob there)

     

  • 05-28-2008 09:10 AM In reply to

    retitled : Node Type in c#

    edited :

    Here, I got the real problem, the field which must be promote so sharepoint must be a double, in order to sum properly the data.

    And I used the code

    MainDataSource.CreateNavigator().SelectSingleNode("/my:DemandeConge/my:nb_jours",

    NamespaceManager).SetValue(DateDif.ToString());

    Which is not good, because the type must be double. And the SetTypedValue 'IsNotImplemented'

    Sorry for the misunderstanding on my prob, anything to solve this 'SetTypedValue' ?

     

  • 06-11-2008 08:09 AM In reply to

    Re: retitled : Node Type in c#

    The basic use (msdn example) show me a : NotImplementedException

     On msdn

    Although the implementation of the XPathNavigator object in InfoPath 2007 exposes the SetTypedValue method—which is used to set a node using a value of a specific type—InfoPath does not implement that method. You must use the SetValue method instead, and pass a string value of the correct format for the data type of the node.

    So What is the correct format for double ?_? if I pass a string "3.1" it fails

  • 06-20-2008 09:14 PM In reply to

    Re: retitled : Node Type in c#

    Hi, Yurnero:

    When I tested this, I needed to remove the xsi:nil attribute in order to successfully set the value of a double. Please see this blog post from the InfoPath Team for more information on this: http://blogs.msdn.com/infopath/archive/2006/11/28/the-xsi-nil-attribute.aspx

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