Count - fail! - InfoPath Dev
in

InfoPath Dev

Count - fail!

Last post 10-25-2010 09:56 AM by cbernal. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 10-19-2010 03:49 PM

    Count - fail!

    Hi,

     I'm using infopath 2007 to create some security reports. After I generate my reports I would like to have totals of each section from section from this report. I've been reading how to do this with xpath, but I honestly don't get how to make this with the COUNT(../my:field1:field2) option. Any help is very appreciated. I apologize for the huge letter, but I wanted to explain as much as possible my situation.

    Basically I run a query with a report number and it populates in two Views. My Policy view (Repearting View) and a Summary View (non repeating text boxes) 

    Policy View has items from 1 to 110 in a repeating table with this structure (this list populates just fine)

    Tracking Number -   SI            - Requirement      -        COMPLIANT?  -    Type

       Autonumber            1           Fix and Resend                  No                      A

       Autonumber            4           Fix and Resend                  No                      A 

       Autonumber            33         Fix and Resend                  Yes                    B

       Autonumber            105       Fix and Resend                  No                      C

    Summary View has the following non-repeating textboxes

    Total of non-compliant items = In this case should be 3

    Total of Type A = 2

    Total of Type B = 0 * Because the item is compliant

    Total of Type C = 1

    Here is my db structure. I created 3 separate fields where to count this data.

    myfields

       datafields

            d:CSAR

                   Type (* A B or C)

                   CountA

                   CountB

                   CountC

                   CountALL

     

    And finally this is my criteria that...does not really work:

    CountALL default value= count(@SI_[. and @Status = "No"])   - "Count all SI if the Status is equal to No"

    CountA=count(../CSAR/CountA) + 1

    CountB=count(../CSAR/CountB) + 1

    CountC=count(../CSAR/CountC) + 1

     

    Thanks in advance,

     

    Carlos

  • 10-19-2010 03:50 PM In reply to

    in fact I forgtot to mention that the returned value is always 1 for the A, B and C values...and the CountALL returns 0

  • 10-19-2010 04:14 PM In reply to

    Any chance you could attach a sample form in a reply (under the Options tab). I'm looking at your DB structure -- that must be from you main data source? And then there is another data source? At any rate, a sample form would really help make the question less confusing....
    Hilary Stoupa

  • 10-19-2010 04:43 PM In reply to

    Hi Hillary,

     

    I had to remove all extras, but this is the basic structure.

    on the general details fields PSC and ISC is where I want to store my counts of Policy_Codes and Physical_Security_Codes. I also need counts for Tab_Codes and another for SI_ just like the way I want to make counts for PSC and ISC.

     The only diference is that for SI must be filtered whenever Compliance_Status is equal to "No"


  • 10-19-2010 04:56 PM In reply to

    And here is the form... I also took all the conf data of it.

     

    Thank you.

  • 10-21-2010 04:02 PM In reply to

    Hi -- just saw your PM, thanks for letting me know about having posted your form. I'll take a look in the next day or so!
    Hilary Stoupa

  • 10-21-2010 04:40 PM In reply to

    Hi -- I added an expression box on your Summary view that counts SI_ fields where Compliance_Status = "No". The XPath looks like:

     count(dfs:dataFields/d:CSAR/@SI_[../@Compliance_Status = "No"])

    So you know, XPath is case sensitive, and "No" is not the same as "NO" or "no" of "nO". So you'll want to make sure that the text is correct. I've attached the sample back to this post...

    Hilary Stoupa

  • 10-25-2010 09:56 AM In reply to

    It works!! you are so Amazing! thanks for helping me out with this...

     

    Carlos

Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.