Display Horizontal Line between repeating sections - InfoPath Dev
in

InfoPath Dev

Display Horizontal Line between repeating sections

Last post 05-10-2011 12:53 AM by Patrick Halstead. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 05-08-2011 05:03 AM

    Display Horizontal Line between repeating sections

    Hi Everyone,

    I have come across a problem which I am unable to find a solution for thus far. The client I am working for needs to have a horizontal line displayed between each repeating section on the custom print view of the form. The repeating section does contain a repeating table (at the end of the repeating section) as well if that is of any help (as I have even tried to use the footer to display the necessary line - but with no luck). At the moment I have a normal section in the repeating section which contains a horizontal line. This section has conditions on it which are associated to a counter which is equal to how many repeating sections there are.

    The section doesn't evaluate as I would like it and hence my problem. I need the following -

    Repeating section
    --------------------------
    Repeating section
    --------------------------
    Repeating section

    If there is only one repeating section then the section hides fine, if there is two or more then the line either hides all the time or displays like the following -

    Repeating section
    --------------------------
    Repeating section
    --------------------------
    Repeating section
    --------------------------

    NOTE THE HORIZONTAL LINE AT THE END!

    The horizontal line cannot be shown at the end as the business requirements specifically states "between" repeating sections.

    Is there any way to do this? Any input would be greatly appreciated as I have been beating my head against a brick wall for the past three working days trying to find a solution for this.

    Oh, almost forgot I am using Infopath 2003

    Thanks in advance

    SimpsonB

  • 05-08-2011 12:56 PM In reply to

    Re: Display Horizontal Line between repeating sections

    Hi SimpsonB,

    Yes, you can do this, but the condition might be a little tricky since your xpath will have to use position() and compare to count(), or store a hidden value in the repeater that increments when new items are added (default value of count()). Reply with your xpath. Don't forget to expand it so we can see the details.

    Best,

    Patrick Halstead
    Project Manager at Qdabra
  • 05-08-2011 04:22 PM In reply to

    Re: Display Horizontal Line between repeating sections

     Hi Patrick,

    I have used position() do display the iteration of the repeating section with success. I added an expression box to the print view within the repeating section just to see if that function was working correctly and it was. At the end of the first section it would show 1, after the second 2 etc etc, so if we could arrive at a solution using position that would be great. I think the section which contains the horizontal line is falling over with how I am comparing it to the position(). I think what is happening is that the last position() occurance is comparing to the counter (eg 4 = 4) then hides all of them. Unfortunately I don't have enough knowledge / understanding on how to rectify this.

    The xpath of my counter is - ns1:formData/ns1:supportNeedsCounter

    The xpath of my repeating section is -  ns1:formData/ns1:supportNeeds

    The repeating seciton contains 2 nodes for storing information and a repeating table.

    I am able to move any nodes within the schema if that makes it any easier to find a solution for my problem. Eg put the counter within the repeating section etc

    Thanks

    SimpsonB

  • 05-08-2011 06:03 PM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Display Horizontal Line between repeating sections

     This might not be the only way to do it, but I've attached an example which does what you describe. Hope it helps.

  • 05-09-2011 05:38 AM In reply to

    Re: Display Horizontal Line between repeating sections

     Hi Skarn,

     Thank you very much for the template, it worked a treat!!!!!!! I was able to use it and match it to my schema which made it easy as 1 2 3.

     I found out that my would never have worked no matter what I tried as I bound the repeating section which contained the horizontal line to my repeating section and not a node contained with in it. 

     Thanks again

    SimpsonB

     

  • 05-09-2011 10:38 PM In reply to

    Re: Display Horizontal Line between repeating sections

    Skarn, you are rocking this forum! Nice job. What's with the "oil" character on your bandana?

    Patrick Halstead
    Project Manager at Qdabra
  • 05-10-2011 12:08 AM In reply to

    • Skarn
    • Top 50 Contributor
      Male
    • Joined on 04-20-2008
    • Australia
    • Posts 198

    Re: Display Horizontal Line between repeating sections

     I enjoy sharing, and I didn't know it said oil! Just a character from one of my favourite TV shows/cartoons.

  • 05-10-2011 12:53 AM In reply to

    Re: Display Horizontal Line between repeating sections

    Thanks for sharing! We will promote you to moderator when you reach 100 posts.

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