Disable control based on page numbering (last page) - InfoPath Dev
in

InfoPath Dev

Disable control based on page numbering (last page)

Last post 10-01-2011 01:39 AM by K.Sarkar. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 07-30-2010 03:11 PM

    Disable control based on page numbering (last page)

    I finally got the repeating table header to print on multiple pages when the row exceeds more than a page could handle. Many thanks to Matt Faus (http://www.infopathdev.com/blogs/matt/archive/2005/11/29/Repeat-Table-Headers-Across-Multiple-Printed-Pages.aspx), Jimmy Rishe (http://www.infopathdev.com/blogs/jimmy/archive/2009/03/06/automatically-adding-rows-to-repeating-sections.aspx), and Vishal Monpara (http://blog.vishalon.net/index.php/infopath-a-proper-way-to-blank-out-whole-number-date-using-jscript). My entire script composed of codes I found on their blogs. :)

    I'm still trying to figure out how to avoid the first blank page I'm getting but that's another story. My more pressing issue is this: 

    One of the columns in the repeating table is "OPAmt" and in the repeating table footer, i added a control "TotalOPAmt" which has a default value of sum(OPAMt). 

    Now I want to disable this control if the page is not the last page. I only want to display the grand total on the last page.  Is this doable? I'm using infopath 2003 sp1.

    Any help and guidance is much appreciated.

    Thank you,

  • 07-30-2010 09:24 PM In reply to

    Re: Disable control based on page numbering (last page)

     You can put the control "TotalOPAmt" on a section and make a conditional formatting on it based on the number of line of your repeating table.

    If Current position of "TotalOPAmt"< total number of line  you don't display it.

    You can have your curent position with a calculated field : count(preceding-sibling::my:item) + 1

  • 08-02-2010 09:39 AM In reply to

    Re: Disable control based on page numbering (last page)

    I'll try this out soon. Thanks Potemkine. ^^
  • 08-02-2010 09:44 AM In reply to

    Re: Disable control based on page numbering (last page)

     Please, let me know if it's working.

  • 08-04-2010 03:34 PM In reply to

    Re: Disable control based on page numbering (last page)

     

    Hi Potemkine, I couldnt figure out how to use position() but using your example, I figured it out by adding 2 fields, one to display a row count, and the other to capture the max(rowcount). Then using jscript I found on one of the sites listed above, I managed to display the grand total on the last page only. This issue is resolved...but now I have another issue. I'm about to give it up with coding infopath, with my very limited, almost none, scripting experience, it's very frustrating. But thanks to this forum and members, I'm learning a lot too.

     Thank you so much.

  • 08-04-2010 04:27 PM In reply to

    Re: Disable control based on page numbering (last page)

     Hi Azudaioh, can you tell me more about you other issue.I begining to programming in Jscript like you, I was frustated too, when you want to change a little thing, you have too make lots of debugging...the problem is that you can't have any debbuging mode with some quick watch. I change for a managed code. I choose C#, and it's really easier to develop.

    If I can help just ask.

  • 08-04-2010 04:57 PM In reply to

    Re: Disable control based on page numbering (last page)

    I thought I'd chime in -- I too prefer C#, but I found out a while back that you CAN debug jscript in InfoPath -- here's a Microsoft KB with more info.

    Hilary Stoupa

  • 08-04-2010 06:49 PM In reply to

    Re: Disable control based on page numbering (last page)

     THanks Hilary, It's good to know.

  • 10-01-2011 01:39 AM In reply to

    Re: Disable control based on page numbering (last page)

    Hi AzuDaioh . I have a similar type of problem. I have a Repeating Table with Header & Footer on every page. If numer of rows in repeating table excees 20, it will move to next page and insert another 20 blank rows by cloning from sampledata.There is a Text Control "Grand Total" in Footer which I want to be printed on last page only. I have tried conditional formatting but it is either open in all pages or hidden in all pages.I use javascript in my Form.

    I have already posted the problem in forum on 29.09.11.

    Please Help.

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