Infopath form is really slow

E

Estyn Edwards

I have a web-enabled Infopath 2007 form that has 9 data sources retrieving
data from an SQL2005 database. The largest source only retrieves 1300
entries and most retrieve around 50. The form is slow in response when
entering information into a field and then clicking on the next field
(approx 15 seconds to respond). The datasources populate drop down lists (2
are in repeating tables). When I have the datasource removed the form works
normally. However when I add the sources back again, the form works slowly
(even if I don't bind the sources to the drop down lists). The data sources
use a data connection library on my sharepoint site. The dropdown lists are
populated with data very quickly and i can use them right away, so it's not
the data that is taking to long, if i check with SQL Profiler the database
isn't being contacted after the initial load. Even if i wait a few minutes
after the form has loaded there is still a 15 second delay after i enter any
data into any fields.



Any thoughts?
 
L

Lance M

When you have a data connection that pulls a large number of files or
data from somewhere, it will slow infopath down because it tries to
keep track of all the different files. Even if these are small files,
like the infopath xml documents, your form will suffer for them. Two
solutions I have found to this involve programming: the first is to
gather data from your data sources programmatically to limit the number
pulled; the second is to filter the data you get from your
dataconnection programmatically. The easiest of the two is the second
option. If possible, you can go through your data connection and filter
out the data that you know for certain will not be needed with this
specific form. So long as infopath doesn't have to keep track of more
than a couple hundred documents, it is somewhat manageable. Here is
some sample code:

'this gets the specific data that you want that you want
docHolder = myDoc.selectSingleNode("special xpath
query").cloneNode(true)

'this will clear the data connection and prevent your form from being
slow
myDoc.childNodes(0).removeChild(myDoc.childNodes(0).childNodes(0))

'add the files you selected back into the dataconnection
myDoc.childNodes(0).appendNode(docHolder)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top