Problem - Infopath can not open select form - InfoPath Dev
in

InfoPath Dev

Problem - Infopath can not open select form

Last post 07-18-2012 08:48 AM by harishreddy1701. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 07-17-2012 08:10 AM

    Problem - Infopath can not open select form

    Hello,

    I don't understand why I can not execute the following code in Infopath 2007 Visual Basic. I am using the following code on button click event. When I preview I get the alert "Infopath cannot open selected form" . Please help.

    Dim myNavigator As XPathNavigator = MainDataSource.CreateNavigator()
    MessageBox.Show(myNavigator.OuterXml.ToString(),"Main Data Source XML")

    Thanks.
    Harish

  • 07-17-2012 11:01 AM In reply to

    Re: Problem - Infopath can not open select form

    Will the form open if not previewed? That is, if you double click on the xsn or the xsf, does the form open?

    Is the form set to preview with a data file that may no longer be present? Under Tools / Form Options / Preview.

    Hilary Stoupa

  • 07-17-2012 02:35 PM In reply to

    Re: Problem - Infopath can not open select form

    When I double click the form, I get an error:

    Expected end of statement
    File:script.vbs
    Line:170

  • 07-17-2012 02:47 PM In reply to

    Re: Problem - Infopath can not open select form

    Sounds like you are using managed code in a script file? What is the programming language you are set to use in the form? Form Options > Programming

    Hilary Stoupa

  • 07-17-2012 07:23 PM In reply to

    Re: Problem - Infopath can not open select form

    harishreddy1701:

    I don't understand why I can not execute the following code in Infopath 2007 Visual Basic. I am using the following code on button click event. When I preview I get the alert "Infopath cannot open selected form" . Please help.

    Dim myNavigator As XPathNavigator = MainDataSource.CreateNavigator()
    MessageBox.Show(myNavigator.OuterXml.ToString(),"Main Data Source XML")

    Thanks.
    Harish

     

     Hello, Harish,

    your datasource XML file should be on network share (shared folder) with configured permissions for it. if it is on remote to Sharepoint Server 2010 machine. Also since it is external to Sharepoint  source, the form needs Full Trust and administrator approval

    I believe that default OOTB permissions on Windows Server (it is where Sharepoint Server always run) at operating  system level prohibit accessing files  

    I would have uploaded the XML file to, for example, to Site Assets of server and used/accessed it from there
    It is much simpler

    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
  • 07-18-2012 07:07 AM In reply to

    Re: Problem - Infopath can not open select form

    Hilary,

     It is VBScript.

    Thanks.

  • 07-18-2012 07:10 AM In reply to

    Re: Problem - Infopath can not open select form

    Vanin,

    Thanks for your response. Right now both XSN and the datasource XML files are in same folder on the same network share drive. I have not published the form yet. Does it matter?

    Thanks.
    Harish

  • 07-18-2012 07:48 AM In reply to

    Re: Problem - Infopath can not open select form

    Then you'll not want to use managed code. :-) XPathNavigator is used in IP 2007 and IP 2010 managed code - you can either change the programming language for your form, or use the appropriate syntax.

    http://www.infopathdev.com/tags/vbscript/default.aspx

    Hilary Stoupa

  • 07-18-2012 08:48 AM In reply to

    Re: Problem - Infopath can not open select form

    Thanks Hillary!

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