Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Add Page Break in as a nested loop

  1. #1
    Junior Member
    Join Date
    Nov 2021
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Add Page Break in as a nested loop

    My script is below. I want to add a page break when a new employee comes about. I cannot do a simple count loop because the rows will vary by person since the variable name changes I do not know how to do this. Any help would be appreciate it.

    Test 3rd Party<br />
    <br />
    *
    <table border="1" cellpadding="5" cellspacing="0">
    <tbody>
    <tr>
    <th>Assignment</th>
    <th>Employee Name</th>
    <th>Discipline</th>
    <th>Date</th>
    <th>Start</th>
    <th>End</th>
    <th>Hours</th>
    <th>Time Off</th>
    </tr>
    <tr>
    <td>{tablerow from=$_rows item=_row}{$costcentersfullpath}</td>
    <td>*{$_row.name}</td>
    <td>{$_row.discipline}</td>
    <td>{$_row.date}</td>
    <td>{$_row.start}</td>
    <td>{$_row.end}</td>
    <td>{$_row.hours}</td>
    <td>{$_row.TimeOffName}{/tablerow}</td>
    </tr>
    </tbody>
    </table>
    *<br />
    <br />
    *
    Last edited by JenHop; November 6th, 2021 at 04:22 PM.

  2. #2
    Junior Member
    Join Date
    Nov 2021
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Add Page Break in as a nested loop

    Hi my script is posted. I am trying to add a nested loop in the table that says when there is a change in employee insert a page break. I cannot figure this out. Any help will be appreciated.

    3rd Party<br />
    <br />
    *
    <table border="1" cellpadding="5" cellspacing="0">
    <tbody>
    <tr>
    <th>Assignment</th>
    <th>Employee Name</th>
    <th>Discipline</th>
    <th>Date</th>
    <th>Start</th>
    <th>End</th>
    <th>Hours</th>
    <th>Time Off</th>
    </tr>
    <tr>
    <td>{tablerow from=$_rows item=_row}{$costcentersfullpath}</td>
    <td>*{$_row.name}</td>
    <td>{$_row.discipline}</td>
    <td>{$_row.date}</td>
    <td>{$_row.start}</td>
    <td>{$_row.end}</td>
    <td>{$_row.hours}</td>
    <td>{$_row.TimeOffName}{/tablerow}</td>
    </tr>
    </tbody>
    </table>
    *<br />
    <br />
    <br />
    *
    <div><formfeed></formfeed></div>
    *

    <table class="MsoTableGrid" style="border-collapse:collapse; border:solid windowtext 1.0pt">
    <tbody>
    <tr>
    <td style="border:solid windowtext 1.0pt; width:116.85pt; padding:0in 5.4pt 0in 5.4pt" valign="top" width="156"><b>Employee Name</b></td>
    <td style="border:solid windowtext 1.0pt; width:116.85pt; border-left:none; padding:0in 5.4pt 0in 5.4pt" valign="top" width="156"><b>Total Hours</b></td>
    <td style="border:solid windowtext 1.0pt; width:116.9pt; border-left:none; padding:0in 5.4pt 0in 5.4pt" valign="top" width="156"><b>Approved</b></td>
    <td style="border:solid windowtext 1.0pt; width:116.9pt; border-left:none; padding:0in 5.4pt 0in 5.4pt" valign="top" width="156"><b>Comments</b></td>
    </tr>
    <tr>
    <td style="border:solid windowtext 1.0pt; width:116.85pt; border-top:none; padding:0in 5.4pt 0in 5.4pt" valign="top" width="156">{tablerow from=_rows item=_row}{$name}</td>
    <td style="border-bottom:solid windowtext 1.0pt; width:116.85pt; border-top:none; border-left:none; border-right:solid windowtext 1.0pt; padding:0in 5.4pt 0in 5.4pt" valign="top" width="156">{$Hours1+$Hours2}</td>
    <td style="border-bottom:solid windowtext 1.0pt; width:116.9pt; border-top:none; border-left:none; border-right:solid windowtext 1.0pt; padding:0in 5.4pt 0in 5.4pt" valign="top" width="156">*</td>
    <td style="border-bottom:solid windowtext 1.0pt; width:116.9pt; border-top:none; border-left:none; border-right:solid windowtext 1.0pt; padding:0in 5.4pt 0in 5.4pt" valign="top" width="156">*</td>
    </tr>
    </tbody>
    </table>
    <br />
    *

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Add Page Break in as a nested loop

    Looks like this is javascript, a different language from java.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. nested do while loop
    By crogn in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 5th, 2014, 02:03 PM
  2. Need help with this nested loop
    By beerye28 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 22nd, 2013, 09:51 PM
  3. Help with interrupting a loop without break or continue
    By mwr76 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 11th, 2011, 08:51 PM