Form Completion Percentage in VB - InfoPath Dev
in

InfoPath Dev

Form Completion Percentage in VB

Last post 12-15-2008 02:45 AM by Frederik Van Lierde. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-12-2008 04:15 AM

    Form Completion Percentage in VB

    Hey, I have asked this question before and I did get a reply but only in C#.

     

    Sadly, I now found out that my entire form is made in VB, not C.

    My question is really, could anyone give me code that calculates how many fields are filled in and converts that into a percentage?

    This would be very usefull for my metadata, I'm kinda stuck with it. I need to learn my .net soon!

     

    Thanks for the help.

  • 12-12-2008 05:34 AM In reply to

    Re: Form Completion Percentage in VB

    If you show us the C# code you have, somebody here would be happy to give you the VB equivalent.

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

    Re: Form Completion Percentage in VB

    int numberOfFields = nodeList.Count;

     

    Courtesy of Shiva :).

  • 12-13-2008 06:15 AM In reply to

    Re: Form Completion Percentage in VB

    Hello again,

    I'm afraid it really isn't as simple as that, in C# or in VB.  I will try to think of a way to determine the number of completed nodes vs. the number of nodes in the form and will get back to you soon.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-15-2008 02:45 AM In reply to

    Re: Form Completion Percentage in VB

    Hi

     

    Do you nned this in VB?  There are way to to this out-of-the-box.  All depends an how your datasource is structured.  The fields you like to count, are they  just fields under the root, or are they fields within a repeating node ?

    The next example shows the xpath to calculated the percentage of how many lines were filled in correctly within a repeating node
    So i éade an extra field ControlIsExecuted related to rules to be sure and gets Y as all fields are fillid in, otherwhise N

    count(/my:expenseReport/my:MyControls/my:MyControl/my:ControlIsExecuted[text() = "Y"]) div count(/my:expenseReport/my:MyControls/my:MyControl) * 100

    /my:expenseReport/my:MyControls/my:MyContro 0 repeating node
    ControlIsExecuted = the fields i need to check
    div = divide

    I hope this directs you to a solution (outside VB)

    Frederik Van Lierde
    Blue InfoPath Blog  ¦  SilverSands Associate  ¦  Do you follow me already?  ¦  We work smart, not hard


    If this article was helpfull, don't forget to rate it, tnx!
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.