Slow View - InfoPath Dev
in

InfoPath Dev

Slow View

Last post 01-12-2009 01:49 PM by murphythadog. 41 replies.
Page 1 of 3 (42 items) 1 2 3 Next >
Sort Posts: Previous Next
  • 12-23-2008 07:53 AM

    Slow View

    I have a form with 26 views so far.  Most of the views are smaller and in preview mode I can change numbers and the calculations are done rather quickly, one of my views has about 60 lines of input, when I make a change in a number the calculation takes about 10 seconds to complete.  Is this normal?  Also when I open up the form in preview mode it takes about 30 seconds to open.  I don't know if they will like this form if it is slow.  Is there a way to stream line forms so that they open faster and perform calculations faster?  I can post my form if necessary. 

    Murphy tha Dog
  • 12-23-2008 08:55 AM In reply to

    I don't know of any way to generically make a form faster, but there might be a way to make your calculation more efficient.  If you give us some more detail on the calculation you're doing, one of us can probably give you some advice on making it faster.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-29-2008 06:46 AM In reply to

     Basically the calculations are fairly straight forward.  I have a table:

     

    Number of rooms   |Sqr Footage   |Total Area   |

    3                          |180                |540            |

    1                          |100                |100            |

    Total Net Area                             |640            |

    Gross Factor                               |1.30           |

    Gross Sqr Ftg                             |832             |

     Basically you multiply number of rooms to get sqr footage per room, then add those to get the total, then multiply the total area by the gross factor, to get the gross sqr. ftg. 

    Murphy tha Dog
  • 12-29-2008 09:33 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Hello,

    In your code you can use the below statement before starting the calculations and end with another statement.

    //Disable for auto update view

    XDocument.View.DisableAutoUpdate();

    Here is your onload code.

    //Enable for auto update view

    XDocument.View.EnableAutoUpdate();

    Try to reduce unncessary code in onload.

  • 12-29-2008 11:38 PM In reply to

    Thank you for that information.  Could you go into a bit more detail about how, specifically, your form is performing those calculations?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-30-2008 01:38 AM In reply to

    Hi,

    Are there any data connections with ‘Automatically retrieve data check box checked'? If that data connection has more data or the access to that data connection is slow then the form may be opened slowly. But this is for any view not specifically one view.

    Swathip
    www.ggktech.com
  • 12-30-2008 06:08 AM In reply to

    The data is all contained within the form. 

    Murphy tha Dog
  • 12-30-2008 06:13 AM In reply to

     Basically the form has over 26 views, each view is a different set of calculations.  Or each view is a different portion of a building.  There is a cover sheet, there is a TOC/Summary sheet that takes each building area and totals the gross area of each view.  Then that will be broken out into stacking options for the client.  Will the building take up more space vertically or horizontally.  Then it will break down cost of each area considering the price per square footage as well as an economic multiplier. 

    Murphy tha Dog
  • 12-30-2008 06:38 AM In reply to

    Ok, thank you, but on this problematic view specifically, how are the calculations being performed, in InfoPath terms? That is, how is it multiplying (number of rooms) by (square footage) to determine (total area), how is it summing those areas to arrive at total net area?  Is it using rules? code?  If so, where and when?  What are the actual formulas the form is using?  I need more details like that before I can try to give you anything concrete.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-30-2008 06:55 AM In reply to

     Oh I see, the functions are within the text boxes, so Room Name is a text box that is a text string, then qty is a text box that is a whole number, sqr footage is a text box that is a whole number, then total is a textbox with a function inside of it that multiplies the qty field to the sqr footage field, then thetotal net area is a text box with a whole number with a function of all the sqr footage fields added up so if i have 30 fields with sqr footage, then those are all added up in that text box.  The net to gross factor is a decimal number with 2 decimal places in that text box.  The Departmental Gross Area is a textbox in Decimal format with (0) decimal places, and the function in that text box is Total Net Area * Net to Gross Factor.  Maybe if I posted my form it would be easier to see. 

    Murphy tha Dog
  • 12-30-2008 06:56 AM In reply to

     How do I post my form to the site?  :)

    Murphy tha Dog
  • 12-30-2008 07:17 AM In reply to

    If you reply to this thread, then click the Options tab, you can attach your form there.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-30-2008 07:54 AM In reply to

     Just tried that it's 195kb and the maximum kb for this site is 128kb.  Let me see if I can take out a few so the upload will work. 

     I took out over half my views.  This is what it will look like minus a few views.   

    Murphy tha Dog
  • 12-30-2008 07:23 PM In reply to

    Hello again,

     I've taken a look at your form.  I'm not sure how much can be easily done to speed up the form.  I'm guessing it takes so long to load up because it has to perform hundreds of calculations before the form is even displayed.  I think the form's data source could have a much simpler structure and that would probably speed it up, but actually working with it would be a bit complicated, so let's try to work with what we've got.

     To speed up the calculations in the individual views, you can try the following (please make a backup of your template before you try this):

    1. Create a new group in the data source.  For the Emergency Room view, you might call it "emergencyTotals"
    2. Move each of the individual total fields (not the aggregate total net and gross total) in that view to the emergencyTotals group (you can do this by right-clicking them in the data source task pane and selecting "Move")
    3. Then open the properties for the field being used as the total net area. Click the formula button, delete the formula, and insert the sum() function.  Inside the sum() function, use the Insert Field or Group button to insert the emergencyTotals group.  Then check the Edit XPath box and insert /* after the group name.  In my case, it winds up looking like this:
           sum(../my:emergencyTotals/*)
      That formula tells the form to calculate the sum of all nodes under the emergencyTotals group.  There's a chance that this will operate faster than adding up each of the totals individually because the calculation will take place in a more straightforward manner, but there's no guarantee.  Anyway, I urge you to give it a try.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-31-2008 06:10 AM In reply to

     Thanks for the reply, I just started grouping the fields you are talking about, because it was easier to find.  I tried putting a sum group in  but I did it wrong, I will try to do the method you suggested in edit expath.  I'll let you know how it goes. 

    Murphy tha Dog
Page 1 of 3 (42 items) 1 2 3 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.