Problem with table headers in repeating table - InfoPath Dev
in

InfoPath Dev

Now you can find InfoPathDev on YouTube and Twitter!

Problem with table headers in repeating table

Last post 11-23-2009 04:28 PM by Hilary Stoupa. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 07-09-2007 09:42 AM

    • GLazkano
    • Top 100 Contributor
      Female
    • Joined on 07-05-2007
    • Basque Country
    • Posts 54

    Problem with table headers in repeating table

    Hi,

    I'm working in a project with a lot of repeating sections and tables, and I need a print view which show the header of that table after a page break.

    I've tried this but it don't work on my project and it return this message:


    oDocument.appendChild(oSamplePage.cloneNode(false));

     

    I've tried many other things and nothing works, that's the reason I decided to post this here.

    Can anyone help me?

     

    Thanks.
     

     

     

     

  • 07-09-2007 10:49 AM In reply to

    Re: Problem with table headers in repeating table

    Unfortunateyl, there is no way in InfoPath to force table headers to automatically print across pages. It is definitely a deficiency. It may be possible to hack the XSL to do it, but it would be rather risky. There is one other thing you could try if your rows are of fixed height. You could redo the structure as a repeating section with some special logic. Here's what you'd do:

    1) outer repeating section tied to your repeating node.

    2) inner section #1 tied to or any child node. put a 1 row table in this to have a header row.

    3) inner section #2 tied to any child node. put a 1 row table in this with same columns as the header row and put your actual data fields in here.

    4) innser section #3 tied to any child node. insert a page break (from insert menu) in this.

    5) put conditional formatting on the section #1 to only show if your "position()" is a multiple of say 25 (i'll let you figure out the formula) or if it's position()=1.

    6) put conditional formatting on the section #3 to only show if the position is a multiple of 25 - 1 so that the page break comes right before the header.

     This requires fixed height table rows and then you cna calculate it out and get a fairly good approximation of headers repeating at the top of each new page.

     

    I hope this helps set you in the right direction. Thanks.

    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-10-2007 12:09 AM In reply to

    • GLazkano
    • Top 100 Contributor
      Female
    • Joined on 07-05-2007
    • Basque Country
    • Posts 54

    Re: Problem with table headers in repeating table

    Thanks, I will try it inmediatly!
  • 07-10-2007 12:47 AM In reply to

    • GLazkano
    • Top 100 Contributor
      Female
    • Joined on 07-05-2007
    • Basque Country
    • Posts 54

    Re: Problem with table headers in repeating table

    Sorry but I have still a problem.

    I don't know which is the expression to check if a number is a multiple of another.

     

    Thanks again!. 

     

    Update at 16:18  (GMT +1)

     

    I found why it doesn't work: when the form enters in a repeating table, all the content of the fields are shown up, without check the formatting conditions specified on the section. It's like if suddenly all the fields were shown and then (only then) the next section made its job.

     

    I don't know if I'm explaining myself, but I have tried it and It doesn't work. 

  • 07-19-2007 09:31 AM In reply to

    Re: Problem with table headers in repeating table

    Hmm. Well, I wanted to avoid pushing you to have to use code for this, but the following HowTo (complex) also achieves what you want.

    http://www.infopathdev.com/blogs/matt/archive/2005/11/29/Repeat-Table-Headers-Across-Multiple-Printed-Pages.aspx

    I hope that helps.

    Thanks, Shiraz

    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-19-2007 12:35 PM In reply to

    Re: Problem with table headers in repeating table

    I have figured out how to make this work. The EXPRESSION you need to use in your conditional formatting is:

    For the Page Break Section:
    round(count(../preceding-sibling::my:group2) div 8) != count(../preceding-sibling::my:group2) div 8 OR count(../preceding-sibling::my:group2) = 0

    For the Header Section:
    round(count(../preceding-sibling::my:group2) div 8) != count(../preceding-sibling::my:group2) div 8 AND count(../preceding-sibling::my:group2) != 0

    Note it's slightly different for each section so you don't get an initial page break. Also I was wrong about the placement of the page break. Easiest to put it at top above the header. See the screen shot.

    The attached example form template demonstrates this technique.

    Designer screen shot of sample form for printing table headers on each page.

    2007-07-25: This post has been edited for accuracy.

    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-20-2007 03:43 AM In reply to

    • GLazkano
    • Top 100 Contributor
      Female
    • Joined on 07-05-2007
    • Basque Country
    • Posts 54

    Re: Problem with table headers in repeating table

    I'll try that as soon as posible.

     

    Thanks again!

  • 07-23-2007 08:31 AM In reply to

    • GLazkano
    • Top 100 Contributor
      Female
    • Joined on 07-05-2007
    • Basque Country
    • Posts 54

    Re: Problem with table headers in repeating table

    I've tried it and there is no good news...

    For a section wich contains data your example is simply perfect, but as I explained in other reply, I need it for a repeating table. The code made by Matt Faus in that how-to doesn't work in my form, I get an error which was posted as a comment in the how-to, but no one can help me.

     

    I will continue working on your example,  but I have no hope.

     

    If you want I can attach an example of my form, so you can maybe understand me.

    Thanks. 

  • 07-23-2007 08:42 AM In reply to

    Re: Problem with table headers in repeating table

    Right. With a repeating table you have to use code. Using a repeating section to simulate a table layout is really the only way to do it codeless. We frequently use repeating sections for table layout because of the greater control possible. You would have to change your form to use a repeating section instead.

    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 07-24-2007 07:25 AM In reply to

    • GLazkano
    • Top 100 Contributor
      Female
    • Joined on 07-05-2007
    • Basque Country
    • Posts 54

    Re: Problem with table headers in repeating table

    I can't attach an example form I made for you, the forum shows me the error message 'You do not have permission to upload or link to files. Please contact your system administrator.'

     

  • 08-29-2008 02:47 PM In reply to

    • Patrick
    • Top 100 Contributor
      Male
    • Joined on 11-04-2007
    • Texas
    • Posts 51

    Re: Problem with table headers in repeating table

     All I can say is WOW, nice job Shiraz!!!

     

    I got this working very nicely, with one exception...The column headers and the Table that houses the position() and controls has a gap between them.  It's strange because I compared it to your example and the Size settings for the sections are all the same.  Is there any trick to getting the header section to have no gap underneath?  Also, there is a small gap between each "row" in successive repeating sections when they are added.

    -Patrick
  • 09-02-2008 09:22 AM In reply to

    Re: Problem with table headers in repeating table

    For each section, set all the padding and margin values to zero. Also remove the default 1pt white border from around the section.

  • 09-02-2008 10:20 AM In reply to

    • Patrick
    • Top 100 Contributor
      Male
    • Joined on 11-04-2007
    • Texas
    • Posts 51

    Re: Problem with table headers in repeating table

    Awesome Greg!  Thanks, that works perfectly

    -Patrick
  • 11-20-2009 05:39 PM In reply to

    Re: Problem with table headers in repeating table

    Hi Shiraz,

     Great post.... but one question... what if you wanted the second page to contain more rows.   For example, 30 rows for the second page and only 8 rows for the first page.  Is this possible?

  • 11-23-2009 04:28 PM In reply to

    Re: Problem with table headers in repeating table

    Experiment with the sample Shiraz attached to his post, but as I recall, you need to change the 'div 8' part of the formulas to 'div 30' (or whatever your requirement happens to be).

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


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