Forums
This topic is locked
Printing & Repeat Region
Posted 28 Sep 2003 14:30:10
1
has voted
28 Sep 2003 14:30:10 Jenny Arnez posted:
Hi,I need to print to a printer a report from my MySQL database. The database currently has 200 records with more being added each week. I need a page break every 5 records so a record is not broken a part.
How do I print a report from a repeat region with a page break every 5 records?
thanks for your input on this!
jennya
Replies
Replied 02 Oct 2003 16:03:07
02 Oct 2003 16:03:07 Michael Guntenaar replied:
You cant give an print command to your client computer from a webserver <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
What you will have to do is count how many records will fit on one page for the blank space just add some whitespace so the printer will go to the second page.
something like this
<pre id=code><font face=courier size=2 id=code>
$recordCount = 0;
While($bla = mysql_fetch_assoc($bloe)) {
echo($bla['info']);
if($recordCount%5 = 0) { echo("whitespace" }
$recordCount++ ;
}
</font id=code></pre id=code>
What you will have to do is count how many records will fit on one page for the blank space just add some whitespace so the printer will go to the second page.
something like this
<pre id=code><font face=courier size=2 id=code>
$recordCount = 0;
While($bla = mysql_fetch_assoc($bloe)) {
echo($bla['info']);
if($recordCount%5 = 0) { echo("whitespace" }
$recordCount++ ;
}
</font id=code></pre id=code>