Default Values...Text vs. Numbers...Grrrrr - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Default Values...Text vs. Numbers...Grrrrr

Last post 03-30-2012 03:36 PM by nkstrou. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 03-14-2012 10:49 AM

    Default Values...Text vs. Numbers...Grrrrr

    Hi InfoPathers:

    I need to create a summary table in my InfoPath 2010 filler form.  What I have so far is a repeating table that I went into Data/Default Values for and added 12 copies of the row, for a total of 13 rows.  Then I turned off the ability to insert/delete items.

    The first 3 columns in my table are all textboxes with a data type of text and by going back into Data/Default Values (thanks Hilary!), I was able to add different default text per row - exactly what I needed.  The last 7 columns are all textboxes as well, but they have data types of either whole number (integer) or decimal.  This is because I'm taking counts in the integer fields and calculating percentages in the decimal fields.  However, when I go into Data/Default Values and try to set default values for the integer fields equal to counts of various fields elsewhere in my document, the same formula gets applied to all 13 instances of that field in the table!

    Why is the behavior different for text fields and number fields?  And is there a way I can apply different formulas to each instance of my number field?  For instance, can I use different formulas if I convert my data types back to text, convert those values to numbers, do my calculations, then convert the result back to text?

    Thanks,

    nkstrou

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
  • 03-14-2012 12:11 PM In reply to

    Re: Default Values...Text vs. Numbers...Grrrrr

    This is probbaly a product bug.  Here is another thread on the topic where I commented that may apply to your situation as well: http://www.infopathdev.com/forums/p/21957/75905.aspx#75905

    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 03-14-2012 08:32 PM In reply to

    Re: Default Values...Text vs. Numbers...Grrrrr

    I don't think this has anything to do with the datatype, and I wouldn't necessarily call this a bug, but I agree it is a bit confusing the way this feature is presented.  Due to the way InfoPath forms work, default value formulas can only be defined for all instances of a field in a repeating group.  If you use static values, then you can have different values in each row, because those are just stored in the form's template.xml file.  Could you give us an example of a few formulas you're using that need to be different in each row?  Perhaps there's a way to generalize the formula.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 03-30-2012 07:59 AM In reply to

    Re: Default Values...Text vs. Numbers...Grrrrr

    My form is for running software tests.  View 1 is where the configuration information is entered, view 2 is a series of sections with a test plan for each possible test (and the irrelevant tests get hidden as the configuration options are marked), view 3 is the result summary where I have the repeating table I'm working with.

    On the test plan page, I have several sections with other repeating tables that point to the data that was entered on the first page (so that the tester doesn't have to flip back and forth to see what was entered), but then I also have extra fields for Expected Result, Actual Result, and Pass/Qualified Pass/Fail (these latter are option buttons).

    The result summary basically takes counts of all the Pass/Qualified Passes/Fails to get the total number of tests, but it's in the test plan sections themselves that I separately calculate the number of Passes, Qualified Passes, Fails and run percentages where % Passes = # Passes/# Tests, % Qual Passes = # Qual Passes/# Tests and %Fails = # Fails/# Tests.  Each row number in the repeating table I'm trying to build on the Summary page corresponds to the results for one of the tests on the Test Plan page.

    So the counts are based on different option button controls in different sections - and the only way to get a consistent formula would be to use row numbers, something like

    For i = 1 to 14

    PctPasses(row i) = Total Passes(row i) / Total Tests (row i)

    PctQPs(row i) = Total QPs(row i) / Total Tests (row i)

    PctFails (row i) - Total Fails (row i) / Total Tests (row i)

    Next i

    Except I don't want to have to do custom code if I can avoid it. 

    I actually have a separate table set up that is not a repeating table that does all the calculations manually, but with 14 rows, that's more than 100 controls in just that table.  I was just hoping to be able to use a repeating table so I could use row-based conditional formatting to hide rows that correspond to tests that weren't run.  On the non-repeating table, I have some conditional formatting that grays out the fields on rows that have tests that weren't run, but it's not very pretty.

    FYI, I tried using qRules to apply a filter to the field to be updated to see if I could update only a particular row, but once again it applies whatever changes I make to every column in the table.  <sigh>  I have a mini-mockup of the repeating table I'm trying to build (minus all the counts/calculations) if you want to look at it. At this point, I've built a repeating table like the one I want to build for the result summary and I'm only trying to see if I can use qRules SetValue to update only one row in the repeating table. If you think it would be helpful to see the mockup, let me know and I'll post it.

     Does this help?  And sorry for the delay in responding - I've been called off to work on other things and have posted a few other questions here in the meantime.

    Thanks,

    Natalie (nkstrou)

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
  • 03-30-2012 08:12 AM In reply to

    Re: Default Values...Text vs. Numbers...Grrrrr

    I think it should be possible to do this, but is there a reason the totals are in a different repeating group from the entry fields?  I think it would be quite a bit easier to have them in the same repeating group.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 03-30-2012 08:33 AM In reply to

    Re: Default Values...Text vs. Numbers...Grrrrr

    While I could in some cases move the fields for the counts to the same repeating group as the entry fields for the test in question, the entry fields come from multiple repeating tables (in a few cases even for the same test!) and I can't bind a single result summary table to multiple repeating groups, so there's not much point.  (if that made sense...)

    My form really is pretty complex.  Here are a few statistics:

    7 repeating tables on the configuration page - with 9 sets of cascading comboboxes (only about 4 of which are unique - the rest just look up their values from whatever was entered in the original)

    14 separate sections (tests) on the test plan page, each one of which needs to feed in to the result summary.

    5 secondary data connections to SharePoint Lists

    Natalie 

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
  • 03-30-2012 03:36 PM In reply to

    Re: Default Values...Text vs. Numbers...Grrrrr

    You know...I just had a thought.  I saw an article on your site by Mel Balsamo I think it was where repeating sections were set up in such a way as to resemble a repeating table where each table entry was 2 rows instead of the standard 1 row.  Would it be possible to set up a series of sections, hide them when the test isn't run (which I know is possible b/c I do that already), and format them in such as way that they look like a single table?  You'd have to do a lot of squishing of borders and cell padding, which is what Mel's article showed.

    What I'm not clear about is whether the sections should be repeating or not (I've not done anything in IP with repeating sections as yet).  Are there binding requirements for those?  And can you conditionally hide repeating sections?

     Thanks,

    Natalie

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.