pour récupérer la valeur d'un champ - InfoPath Dev
in

InfoPath Dev

pour récupérer la valeur d'un champ

Last post 12-10-2008 04:21 PM by djibson. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-25-2008 07:59 PM

    pour récupérer la valeur d'un champ

    J'ai un problème pour récupérer la valeur d'un champ. J'ai une exeception: "L'exception XPath n'est pas géré par le code d'utilisateur."
    (Le gestionnaire de noms ou XsltContext est nécessaire. Cette demande a un préfixe, une variable ou une fonction définie par l'utilisateur.). -Je utiliser Visual Basic et InfoPath 2007.

     

    Dim  xmlDoc  as XmlDocument

    Dim Node as XmlNode  

    Dim sVar as String

    Node =xmlDoc.DocumentElement.SelectSingleNode("/my:mesChamps/my:CODE_RISQUE")

    sVar=Node.value

    S'il vous plait aider moi 

     

    Filed under: ,
  • 12-08-2008 06:32 AM In reply to

    Re: pour récupérer la valeur d'un champ

    Your code is misisng some information:

    First of all the Build would give you an warning that the XmlDoc isn't initiate yet and will be always nothing.

    Another part you are éissing is the fact that the MainDataSource isn't link, so you can't Select the Single nOde in the Main DataSoruce

    Try the following code

    Dim main As XPathNavigator = MainDataSource.CreateNavigator()
    Dim codeRRisque As XPathNavigator
    Dim sVar As String

    codeRRisque = main.SelectSingleNode("/my:myFields/my:field1", NamespaceManager)

    sVar = codeRRisque.Value

     

    Frederik Van Lierde
    Blue InfoPath Blog  ¦  SilverSands Associate  ¦  Do you follow me already?  ¦  We work smart, not hard


    If this article was helpfull, don't forget to rate it, tnx!
  • 12-10-2008 04:21 PM In reply to

    Re: pour récupérer la valeur d'un champ

    Thanks FrederiK for your answer but i've already resolved problem  (same code)  look here :    http://www.infopathdev.com/forums/t/9859.aspx  

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