Modify template at run-time - InfoPath Dev
in

InfoPath Dev

Modify template at run-time

Last post 01-13-2007 10:48 PM by Shiraz Cupala. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-24-2006 04:52 AM

    Modify template at run-time

    How to change data in the XSN file itself at run-time?

    Scenario:
    Send out an XSN file via email so the user can enter reports (in xml format) when not connected to the main server. Updates come back via email. But, one user will create many reports from one template. How do I insert a sequence number in the generated xml files? Also, would like to use Restricted Security so I don't have to make an install package.

    If I could simply write the current sequence number to a field in Template.xml (bundled in the XSN file) it would perfect. Or something similar.

    Any suggestions?

    Crazy Ray
    On vacation in Afghanistan


  • 12-24-2006 10:01 PM In reply to

    Re: Modify template at run-time

    I don't know how one would do this without connecting to a server to determine which number is next in the sequence. You might want to look into using a GUID which is independently and globally unique. If you're using C#.NET as your code behind you can set the field (of string type) to System.Guid.NewGuid();
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-13-2007 10:48 PM In reply to

    Re: Modify template at run-time

    Instead of sending the XSN file you should send an InfoPath XML file generated by the server and the server can inject the sequence number before sending. Since the XML file already will have a reference to the proper XSN deployed on yoru intranet it will just open correctly.

    If you must send the XSN in the email as your deployment method, you can always crack open the XSN on the server, inject the correct number in the template.xml, repackage the XSN and send that. The XSN is just a CAB file with a .XSN extension. There are readily available CAB tools available you can use.
    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.