Destinations for submitting/saving - InfoPath Dev
in

InfoPath Dev

Destinations for submitting/saving

Last post 03-16-2010 06:46 PM by Jimmy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-14-2010 01:17 PM

    • TobyR
    • Not Ranked
    • Joined on 03-11-2010
    • Posts 6

    Destinations for submitting/saving

    I'd like to use Infopath to create a daily checklist.  Creating the form has been very simple, but I'd like some help and advice about saving/submitting the data.  I can see that Infopath is really designed for putting data into a central data store, especially Sharepoint, but that is not an option for me.  Basically, I just need my colleagues to complete the forms and save them in a specific folder for later reference and/or archiving.  How can one set a form to be saved to a sepcific folder, and with a specific calculated name (which I have in mind will be something like "checklist-<yy>-<mm>-<dd>"?  I say "save" instead of "submit" because I get the impression that one can only submit to specialist data stores eg Sharepoint, databases.  

  • 03-15-2010 02:18 AM In reply to

    Re: Destinations for submitting/saving

    you can use a little bit of code behind to do the trick. create a field say field_name on your form. on the load of your form set its value to whatever your want.

    drop a button on your form

    and

    XPathNavigator xnDoc = null;

    xnDoc = this.MainDataSource.CreateNavigator();

    string Doc_name =

    xnDoc.SelectSingleNode("/my:myFields/my:field_name", this.NamespaceManager).Value();

    this.save("your save location" + Doc_name);

     

     

    Qazi Anis
    Technical Architect
    Bitwise Inc
  • 03-16-2010 01:22 PM In reply to

    • TobyR
    • Not Ranked
    • Joined on 03-11-2010
    • Posts 6

    Re: Destinations for submitting/saving

     Thanks for the advice, but I'm having a couple of problems which I hope are just because I'm not a C# developer and are therefore easy to fix!  First, I get an error that in the expression

    xnDoc.SelectSingleNode("/my:myFields/my:field_name", this.NamespaceManager).Value();

    namely "'Value' is a 'property' not a 'method'"

    Second, if I try a test save with  ...

    this.SaveAs(@"C:\test");

    Then I get a security event:

    System.Security.SecurityException
    Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
       at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
       at System.Security.CodeAccessPermission.Demand()
       at Microsoft.Office.InfoPath.Internal.XmlFormHost.CheckFileWritePermission(String fileLocation)
       at Microsoft.Office.InfoPath.Internal.XmlFormHost.SaveAs(String fileUrl)
       at Microsoft.Office.InfoPath.XmlFormHostItem.SaveAs(String fileUrl)
       at DailyRoutineForm2.FormCode.CTRL55_5_Clicked(Object sender, ClickedEventArgs e)
       at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)

     I guess there a re some persmission that need to be changed - any suggestions?  Thanks in advance

  • 03-16-2010 06:46 PM In reply to

    Re: Destinations for submitting/saving

     Value shouldn't have parentheses after it.

     In order to access the local disk from code, as in this case, the form will need to be full trust.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.