How to reduce the time for a Form to load - InfoPath Dev
in

InfoPath Dev

How to reduce the time for a Form to load

Last post 09-14-2005 11:15 PM by Patrick Halstead. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 09-01-2005 11:55 PM

    • rjohnson
    • Top 500 Contributor
    • Joined on 09-02-2005
    • Australia
    • Posts 28

    How to reduce the time for a Form to load

    Hi,

    My situation is that I would like to know what happens between the time a form is downloaded, and the time it takes for a form to finish loading in InfoPath.

    I have noticed that before the form loads, the status bar shows the words "Opening form...", but before it does that there is a pause. I want to know what is happening before the "Opening form..." appears. The "Opening form..." appears faster with a server close by, and takes longers on a server further away.
    This happens every time I load the form. I would have guessed that the file would be cached, so the load time would be similar every subsequent time the form is loaded.

    If the form is loaded from the hard drive (a cached version), it is slightly faster than a server close by.

    I have attempted to publish the form using a NULL reference, as I thought InfoPath's Update feature was causing this, but there is still a difference in speed on a server further away.

    Can anyone tell me what is happening after the form is downloaded, and before the form loads on the screen? Or if anyone can tell me what causes forms to load slower?

    Any help would be appreciated.

    - Reg
  • 09-02-2005 02:46 PM In reply to

    Re: How to reduce the time for a Form to load

    Hi Reg,

    Various things. Update check is probably the main latency with the net if the form is local. Update feature has to check the version number of the form to see if a newer version exists and, if so, download it.

    How big is your XML file? Does your form populate from any external data sources?

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 09-02-2005 06:39 PM In reply to

    • rjohnson
    • Top 500 Contributor
    • Joined on 09-02-2005
    • Australia
    • Posts 28

    Re: How to reduce the time for a Form to load

    Thanks for the reply Patrick,

    There are a few XML files, but they are all located within the directory of the manifest.xsf files. In its uncompressed state, they total about 479KB.

    However, there is a section of the data source which populates via web services. (I didn't design the web services)

    I noticed that the 'Securty Level' was set to Automatically Determine security level based on form's design. I noticed that the radio button was set to 'Domain'.

    I attempted to manually change the 'Security Level' from 'Domain' to 'Restricted', as I thought that the form would be confined to the computer, and would act as if it were being run from the hard drive.

    However, when I change the security settings, the web services no longer work.

    Would the form be trying to connect with the original Server form, if the security level changes?
    Or would there be a way to disabling the Update check?

    Any help would be appreciated.

    Thanks,

    - Reg
  • 09-03-2005 12:53 AM In reply to

    Re: How to reduce the time for a Form to load

    Hi Reg,
    Yeah, you don't want to "restrict" the form if it is using a Web service. My guess is that this may be the main latency on load. To test this, you could go to Tools-Form Options-Data Connections; modify the data connection so that it didn't query on load (last page of wizard) and try to open the form again. If this results in a big savings, then it's the Web services. You could cache the data locally to reduce load times. Anyway, good luck!

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 09-05-2005 07:33 PM In reply to

    • rjohnson
    • Top 500 Contributor
    • Joined on 09-02-2005
    • Australia
    • Posts 28

    Re: How to reduce the time for a Form to load

    Hi all,

    I found this power point document on the internet, that may help people in the future. It gives an overview of what infoPath does before a form loads.

    The Document hasn't helped me with my problem, but has given a greater understanding of how InfoPath works.

    The power point was created by Joshua Bell (Lead Program Manager for InfoPath, Microsoft), entitled "InfoPath: Best Practices for Building Enterprise Solutions".

    I've written the first two steps described by the power point document, of what happens:

    Step 1: Populating the DOM
    *XML comes from:
    A file
    A data connection
    template.xml
    *From older version of template?
    upgrade.xsl (auto-generated)
    OnVersionUpgrade
    *Result is loaded into a DOM

    Step 2: OnLoad Phase
    *Data Connection queries run
    *Declarative calculations evaluated
    *OnValidate code executed
    *Declarative rules run
    *OnLoad code runs
    *DOM events fire
  • 09-05-2005 07:35 PM In reply to

    • rjohnson
    • Top 500 Contributor
    • Joined on 09-02-2005
    • Australia
    • Posts 28

    Re: How to reduce the time for a Form to load

    Thanks for the info Patrick,

    Unfortunately when I removed the data connections, it didn't really make a huge speed savings. I even forced the security mode into "restricted", but still didn't improve load times.

    As noted before, it's strange that the form loads quick on a server close by, and takes longer on a server further away. Clearly it is a networking issue, but am not sure how to entirely remove network reliance on a form.

    Is there a way to only download a form, from the network, but then never connect to the network for either an update or anything else.
    I'll worry about the web services later, but for now I just want to know if it's possible to avoid connecting to a network, and just opening the form as quickly as possible.

    Anyway, thanks for any help as always.
  • 09-07-2005 01:34 AM In reply to

    Re: How to reduce the time for a Form to load

    Hi again,

    I remember talking to Joshua Bell about that presentation at TechEd. It was a great presentation and I highly recommend it for everyone here.

    How big is the form? How big is the xsn? Might be network latency.

    You can make the form URN-based and then it won't update. You can use regform to create a URN-based form that is not tied to an HTTP, but this then means no-one gets auto-update. However, it's worth a try to see if it resolves your issue. Search for regform. I'm sure there are quite a few posts and there should be documentation in the SDK. You can also just use regform /? to get info.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 09-07-2005 04:11 PM In reply to

    • rjohnson
    • Top 500 Contributor
    • Joined on 09-02-2005
    • Australia
    • Posts 28

    Re: How to reduce the time for a Form to load

    Hi again Patrick,

    the XSN is about 600kb all up, including about 150kb of images.

    I attempted to use the regform idea, but it says that it can't be registered, as the "Specified URL is not local." Since the file is on a network drive, I guess it can't be done. However, the regform idea worked very well when published to a local drive, as there is no waiting before the forms says that it's opening.

    I want to make the form available on the network for users to download, but when a user clicks to open the file, it takes a while, as I feel that when the file opens on the local machine, it checks back with the server copy to see if anything has changed...
    Is there any other way to block the update?

    I've looked at trying to sign a form, but have had no real luck. I'll keep trying and if something works I'll report it to the forum.

    - Reg
  • 09-07-2005 08:06 PM In reply to

    Re: How to reduce the time for a Form to load

    I'm confused about the "Specified URL is not local" issue. Just create an MSI and put the MSI on the web site. Users install this into their local cahce and run it from their cache. It subverts auto-update, but it will give you a very fast solution.



    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 09-07-2005 09:53 PM In reply to

    • rjohnson
    • Top 500 Contributor
    • Joined on 09-02-2005
    • Australia
    • Posts 28

    Re: How to reduce the time for a Form to load

    Sorry about the vague post Patrick, I'll clarify it now.

    I ran the following command, on a networked file:
    regform /U urn:MyForm:MyCompany Form.xsn

    as I thought I could make the networked form as an URN, but got the error "specified URL is not local", since it's a network file.

    I later realised that I had to create an MSI file with the command,
    regForm /U urn:MyForm:MyCompany /T Yes /MSI Form.xsn
    and ran it, creating the infoPath file on the hard drive accordingly.

    However, when the msi file is launched with a user who does not have administrator access, which is the majority of the users for the organisation, there is an error "The Following form template cannot be registered C:\Program Files\InfoPath Form Templates\Form.xsn Access is denied."

    Sorry for not mentioning the situation before, but if there is a way around this, it'd be appreciated.

    Thanks as always,

    - Reg
  • 09-07-2005 10:56 PM In reply to

    Re: How to reduce the time for a Form to load

    Very interesting ... ok, well, I think this is a problem with either the way you are running regform or the security you are requesting. Can you run it non-Full Trust or was that a requirement? The real question is why do users not have access. I'm assuming that C:\Program Files\InfoPath Form Templates\Form.xsn is the location of where the form was when you created. You said majority of users, so this is probably a permissions issue. Your regform command looks like it isn't trying to "install" the form there, so I'm confused again. You should be able to specify where the form installs and if you don't it should just go to the temporary internet cache where everyone should be able to write. Are you sure you used the regform command listed above? It doesn't make sense since it should install to the internet cache and not to Program Files unless you specify the install location. Maybe I'm wrong and the Program Files location is the default location. If so, try specifying it to a folder that everyone has write access to.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 09-08-2005 07:29 PM In reply to

    • rjohnson
    • Top 500 Contributor
    • Joined on 09-02-2005
    • Australia
    • Posts 28

    Re: How to reduce the time for a Form to load

    Hi Patrick, thanks for the reply,

    I'll try to clarify what I said before:

    The way I thought regform works, is that you can create an MSI file.
    The MSI file is placed on a server, and a user can download and run it.
    A user would then run that file, and the form would install to a default directory of 'C:\Program Files\InfoPath Form Templates\'. The user can then execute the file, and InfoPath would load.

    However a lot of users for the organisation can't install the MSI file as they get the error "The Following form template cannot be registered ... access is denied". I assumed they get this error because they don't have permission to install programs on their computers. (I believe this is a requirement of the organisation, and I don't have the power to change that)

    I can run it non-Full Trust, with the command
    regForm /U urn:MyForm:MyCompany /MSI Form.xsn[\b], without the '/T Yes' section, I even tried it with[\b] a '/T No', but the MSI problem stil persists.

    I hope that clarified what I was saying before.

    I'm not sure if you can solve this problem I'm having, but any input given would be helpful.

    BTW, I attempted a different solution other than creating a URN file. That idea was that I copied the cache directory of InfoPath forms, from my colleague's computer to mine, and their cache was available and loadable.
    What I wanted to know, is can I run a switch command, to automatically load a cached form. For example, if I had a form called "theCachedForm", could I run infopath with a command "Infopath -cache theCachedform", to automatically load it? Obviously that doesn't work as I would have not asked the question, but is there another switch I could use.

    Any reply would be appreciated as always,

    - Reg
  • 09-08-2005 10:04 PM In reply to

    Re: How to reduce the time for a Form to load

    Hi Reg,
    So, the policy for users is that they cannot install the form locally. I wonder if your company policy is to limit them from installing to C:\Program Files\... or from writing to the registry? Do you know? If it's the former, you may be able to specify a different location to get the install to succeed.

    There is another option and that is to install a URN-based solution on a share. You can change the register.js to just add the solution to the InfoPath cache and leave it on the share. This file should be editable.

    But, why bother with all of this grief!? Why not just do the following. Publish the form to your http or SharePooin location like you normally would. Ask everyone to install it. Then, delete the xsn form the network location! Yes, you heard me right, just delete it. Now, instruct your users to start InfoPath and choose the form from their recently used solutions. Solution opens fine in no time, right? If you ever need to update, just copy the solution back to the location for some time, and then delete it to increase load performance. This works because in SP1 InfoPath added both URN and URL to every solution. So, the form will default back to the cached URN version if it can't find the solution at the destination. The biggest problem with this approach is that users who don't load the form once won't have it and will need a way to get it. However, you might be able to finagle the register.js to install it in the InfoPath cache from the location without writing it locally. Worth investigating ... Even so, this isn't necessarily a showstopper if your users are good about downloading when they are told to do so.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 09-13-2005 05:23 AM In reply to

    • rjohnson
    • Top 500 Contributor
    • Joined on 09-02-2005
    • Australia
    • Posts 28

    Re: How to reduce the time for a Form to load

    Hi Patrick,
    Thanks for your help before, as well as the previous entries you've given.

    There are a lot of security constraints that the users have to deal with, including not being allowed to write the registry. Thus I wasn't able to use an URN-based solution.

    I didn't fully understand your comment about placing an URN-based solution on Share (I didn't think that was possible), but may help someone in the future. Note: I don't use SharePoint, instead the forms are placed in a "shared folder".

    I did come up with 2 work-arounds:
    The prior was to publish the form to the hard-drive. When publishing the form, there are two parts. The first is to decide where the published form is to be stored, and the second is where the form needs to be loaded from. (I didn't understand this, and I thought I'd post it in case someone else wanted to know). Thus I publish the form to a directory, eg: C:\Forms, and users would have to download the forms to the directory and launch the forms from there. I started to automate the process, but stopped after more constraints were encountered. Eg: The forms wouldn't be updated.

    The latter work around, which I'm not 100% sure if it works, is to publish the form to a server, but then to load the form and save it as an empty XML document. The empty XML document is very small, and the users would then open the XML document, and InfoPath would load the correct form for it. This way, the form would be updated if the form needed to be changed, and I would hopefully a good load speed would be achieved. I think loading a form from a server causes some load problems, but I'm not experiencing such problems from a saved file. Note: I made the XML file read-only, so multiple people could open it at the same time.

    I don't know if the above solution works, however in the short time I've tested it, it seems to be ok. If it does work, it could be beneficial to others who have had a similar problem as myself.

    Cheers,

    - Reg
  • 09-14-2005 11:15 PM In reply to

    Re: How to reduce the time for a Form to load

    Reg!
    Thanks for the in depth post. The latter workaround is a good solution. In fact, I'm sorry I didn't think of it. Nice job!

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (15 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.