PDA

View Full Version : how to tell printer to use separate page for each looped output


bazz
05-16-2005, 11:59 AM
Hi,

using foreach, I shall be out-putting the results of a loop for a group of data fro each client.

This will mean that data for each client will be presented in a consistent format and then be printed to paper.

How can I make sure that whereas with the html output appearing on one long html page, I can print the individual clients data to a separate page so that each is of an identical layout.

Is there a specific term, for example, to tell the printer 'new page please'?

Bazz

mlseim
05-16-2005, 01:15 PM
Bazz .... try this.

Display this simple webpage on your browser and
try printing it out. Pretty neat isn't it? :thumbsup:

==========================================

<html>
<body>

<table>
<tr><td>Page 1</td></tr>
</table>

<table style="page-break-before: always">
<tr><td>Page 2</td></tr>
</table>

</body>
</html>

=========================================

With Perl (looping) you could make this a variable:

$page_break = "style='page-break-before: always' ";
print "<table $page_break> \n";



.

bazz
05-16-2005, 01:59 PM
sounds exactly what I'm looking for. I guess, I put it after the specific client details and then, the next one will print out on another page?

yum :)

Thanks Max,

bazz

mlseim
05-16-2005, 03:47 PM
... and I didn't try it with Firefox/Mozilla

I hope it's not just an IE thing.

==============================

$flag=0; #first item
$page_break="";

for loop ...

if($flag==1){
$page_break = "style='page-break-before: always' ";
}
print "<table $page_break> \n";
print "<tr><td>Page 1</td></tr> \n";
print "stuff"
print "</table> \n";

$flag=1;
}