zero118
asked on
Print Headers on Every Page
Now, by no means is PHP hard for me, but people are asking me to take rows of information along with the headers and make them printable. By this I mean on each 8.5x11" peice of paper should show the continuing rows of information but also repeat the table headers at the top of every page. I have no idea how this would work since margins would be different, it would depend on the orientation (portrait or landscape), etc. Below is my code for the section that displays the information. Any help or ideas would greatly help. Thanks.
//DISPLAY LIST OF PARTS FOR A SPECIFIC PUMP -- GET $n (name), $m (mfc info), mc (machine time), $p (price), $pi (price inc), ma (material)
// $w (weight), $u (used in)
// NUMBER REQUIRED, NAME, AND PART NUMBER ARE AUTOMATIC
/*++++++++++++++++++++++++ ++++++++++ ++++++++++ ++++++++++ ++++++++++ ++++++++++ ++++++++++ */
if ($task == 'fulllistshow' && $n != '') {
$m = $_POST['m'];
$w = $_POST['w'];
$mc = $_POST['mc'];
$pr = $_POST['pr'];
$pi = $_POST['pi'];
$ma = $_POST['ma'];
$u = $_POST['u'];
$query_mem_1 = "SELECT `name`, `id`, `noreq`, `desc`, `partnum`, ";
if ($m == 1){ $query_mem_1 .= "`mfc`, `mfcdesc`, `mfcprtnum`, "; }
if ($w == 1){ $query_mem_1 .= "`lbs`, "; }
if ($mc == 1){ $query_mem_1 .= "`mchtime`, "; }
if ($pr == 1){ $query_mem_1 .= "`lstprc`, "; }
if ($pi == 1){ $query_mem_1 .= "`prcinc`, "; }
if ($ma == 1){ $query_mem_1 .= "`matcst`, "; }
if ($u == 1){ $query_mem_1 .= "`usdin`, "; }
$query_mem_1 .= "CAST(SUBSTRING(`partnum`, LOCATE('-', `partnum`) + 1) AS SIGNED) AS `sort_part` FROM `$parts_database_table` WHERE `name`=\"$n\" ORDER BY `sort_part` ASC";
mysql_select_db($database_ name, $connection);
$mem_1 = mysql_query($query_mem_1, $connection) or die(mysql_error());
$row_mem_1 = mysql_fetch_assoc($mem_1);
$totalRows_mem_1 = mysql_num_rows($mem_1);
?>
<head><style>TD.altrow2{ba ckground-c olor: #f7f7f7;}TD.altrow1{backgr ound-color : #d9d9d9;}</style></head>
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td colspan="11" class="prod" style="border-bottom: 2px solid #c0c0c0;"><font face="Tahoma" size="2"><img src="../img/splash-logo.jp g" width="140" height="66" align="bottom" /><strong><font size="3"><?=$n?></font></s trong></fo nt><br />
</td>
</tr>
<tr>
<td width="107" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc; border-left:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Part Number</font></strong>
</td>
<td width="102" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Description<br /></font></strong>
</td>
<td width="72" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">No. Required<br /></font></strong>
</td>
<? if ($m == 1) { ?>
<td width="211" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Manufacturer Information<br /></font></strong>
</td>
<? } ?>
<? if ($pr == 1){ ?>
<td width="97" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">List Price</font></span></stron g>
</td>
<? } ?>
<? if ($u == 1) { ?>
<td width="94" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Reference</font>< /strong>
</td>
<? } ?>
<? if ($w == 1){ ?>
<td width="116" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Weight</font></sp an></stron g>
</td>
<? } ?>
<? if ($ma == 1){ ?>
<td width="100" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Material Cost </font></strong>
</td>
<? } ?>
<? if ($mc == 1){ ?>
<td width="106" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Machine Time </font></strong>
</td>
<? } ?>
<? if ($pi == 1){ ?>
<td width="106" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Price Increase in % </font></strong>
</td>
<? } ?>
</tr>
<? if ($mem_1){
$numOfRows = mysql_num_rows ($mem_1);
for ($i = 0; $i < $numOfRows; $i++){
$name = mysql_result ($mem_1, $i, "name");
$noreq = mysql_result ($mem_1, $i, "noreq");
$partnum = mysql_result ($mem_1, $i, "partnum");
$desc = mysql_result ($mem_1, $i, "desc");
if ($w == 1){$lbs = mysql_result ($mem_1, $i, "lbs");}
if ($m == 1){$mfc = mysql_result ($mem_1, $i, "mfc");}
if ($m == 1){$mfcprtnum = mysql_result ($mem_1, $i, "mfcprtnum");}
if ($m == 1){$mfcdesc = mysql_result ($mem_1, $i, "mfcdesc");}
if ($u == 1){$usdin = mysql_result ($mem_1, $i, "usdin");}
$id = mysql_result ($mem_1, $i, "id");
if ($mc == 1){$mchtime = mysql_result ($mem_1, $i, "mchtime");}
if ($ma == 1){$matcst = mysql_result ($mem_1, $i, "matcst");}
if ($pi == 1){$prcinc = mysql_result ($mem_1, $i, "prcinc");}
if ($pr == 1){$lstprc = mysql_result ($mem_1, $i, "lstprc");}
$desc = htmlentities($desc);
$mfcdesc = stripslashes($mfcdesc);
$alternate = ($i % 2) + 1; ?>
<tr>
<td width="107" align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-left:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate ?>"><div align="center"><font face="Tahoma" size="1"><strong><?=$partn um?></stro ng></font> </span></d iv>
</td>
<td align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate ?>"><font face="Tahoma" size="1"><?=$desc?><br /></font>
</td>
<td align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate ?>"><font face="Tahoma" size="1"><?=$noreq?><br /></font>
</td>
<? if ($m == 1) { ?>
<td width="211" align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate ?>"><font face="Tahoma" size="1">name ><?=$mfc?><br />part # ><?=$mfcprtnum?><br />descrip ><?=$mfcdesc?></font></spa n>
</td>
<? } ?>
<? if ($pr == 1){ ?>
<td width="97" align="right" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate ?>"><font face="Tahoma" size="1">$<?=$lstprc?></fo nt></span>
</td>
<? } ?>
<? if ($u == 1) { ?>
<td align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate ?>"><font face="Tahoma" size="1"><?=$usdin?></font ></span>&n bsp;
</td>
<? } ?>
<? if ($w == 1){ ?>
<td width="116" align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate ?>"><font face="Tahoma" size="1"><?=$lbs?>lbs</fon t> </ span>
</td>
<? } ?>
<? if ($ma == 1){ ?>
<td width="100" align="right" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate ?>"><font face="Tahoma" size="1">$<?=$matcst?></fo nt>
</td>
<? } ?>
<? if ($mc == 1){ ?>
<td width="106" align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate ?>"><font face="Tahoma" size="1"><?=$mchtime?></fo nt>
</td>
<? } ?>
<? if ($pi == 1){ ?>
<td width="106" align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate ?>"><font face="Tahoma" size="1"><?=$prcinc?>  ;</font>
</td>
<? } ?>
</tr>
<? } ?>
</table>
<? }
/*++++++++++++++++++++++++ ++++++++++ ++++++++++ ++++++++++ ++++++++++ ++++++++++ ++++++++++ +++*/
//DISPLAY LIST OF PARTS FOR A SPECIFIC PUMP -- GET $n (name), $m (mfc info), mc (machine time), $p (price), $pi (price inc), ma (material)
// $w (weight), $u (used in)
// NUMBER REQUIRED, NAME, AND PART NUMBER ARE AUTOMATIC
/*++++++++++++++++++++++++
if ($task == 'fulllistshow' && $n != '') {
$m = $_POST['m'];
$w = $_POST['w'];
$mc = $_POST['mc'];
$pr = $_POST['pr'];
$pi = $_POST['pi'];
$ma = $_POST['ma'];
$u = $_POST['u'];
$query_mem_1 = "SELECT `name`, `id`, `noreq`, `desc`, `partnum`, ";
if ($m == 1){ $query_mem_1 .= "`mfc`, `mfcdesc`, `mfcprtnum`, "; }
if ($w == 1){ $query_mem_1 .= "`lbs`, "; }
if ($mc == 1){ $query_mem_1 .= "`mchtime`, "; }
if ($pr == 1){ $query_mem_1 .= "`lstprc`, "; }
if ($pi == 1){ $query_mem_1 .= "`prcinc`, "; }
if ($ma == 1){ $query_mem_1 .= "`matcst`, "; }
if ($u == 1){ $query_mem_1 .= "`usdin`, "; }
$query_mem_1 .= "CAST(SUBSTRING(`partnum`,
mysql_select_db($database_
$mem_1 = mysql_query($query_mem_1, $connection) or die(mysql_error());
$row_mem_1 = mysql_fetch_assoc($mem_1);
$totalRows_mem_1 = mysql_num_rows($mem_1);
?>
<head><style>TD.altrow2{ba
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td colspan="11" class="prod" style="border-bottom: 2px solid #c0c0c0;"><font face="Tahoma" size="2"><img src="../img/splash-logo.jp
</td>
</tr>
<tr>
<td width="107" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc; border-left:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Part Number</font></strong>
</td>
<td width="102" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Description<br /></font></strong>
</td>
<td width="72" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">No. Required<br /></font></strong>
</td>
<? if ($m == 1) { ?>
<td width="211" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Manufacturer Information<br /></font></strong>
</td>
<? } ?>
<? if ($pr == 1){ ?>
<td width="97" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">List Price</font></span></stron
</td>
<? } ?>
<? if ($u == 1) { ?>
<td width="94" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Reference</font><
</td>
<? } ?>
<? if ($w == 1){ ?>
<td width="116" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Weight</font></sp
</td>
<? } ?>
<? if ($ma == 1){ ?>
<td width="100" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Material Cost </font></strong>
</td>
<? } ?>
<? if ($mc == 1){ ?>
<td width="106" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Machine Time </font></strong>
</td>
<? } ?>
<? if ($pi == 1){ ?>
<td width="106" align="left" valign="top" class="prod" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;"><strong><font face="Tahoma" size="1">Price Increase in % </font></strong>
</td>
<? } ?>
</tr>
<? if ($mem_1){
$numOfRows = mysql_num_rows ($mem_1);
for ($i = 0; $i < $numOfRows; $i++){
$name = mysql_result ($mem_1, $i, "name");
$noreq = mysql_result ($mem_1, $i, "noreq");
$partnum = mysql_result ($mem_1, $i, "partnum");
$desc = mysql_result ($mem_1, $i, "desc");
if ($w == 1){$lbs = mysql_result ($mem_1, $i, "lbs");}
if ($m == 1){$mfc = mysql_result ($mem_1, $i, "mfc");}
if ($m == 1){$mfcprtnum = mysql_result ($mem_1, $i, "mfcprtnum");}
if ($m == 1){$mfcdesc = mysql_result ($mem_1, $i, "mfcdesc");}
if ($u == 1){$usdin = mysql_result ($mem_1, $i, "usdin");}
$id = mysql_result ($mem_1, $i, "id");
if ($mc == 1){$mchtime = mysql_result ($mem_1, $i, "mchtime");}
if ($ma == 1){$matcst = mysql_result ($mem_1, $i, "matcst");}
if ($pi == 1){$prcinc = mysql_result ($mem_1, $i, "prcinc");}
if ($pr == 1){$lstprc = mysql_result ($mem_1, $i, "lstprc");}
$desc = htmlentities($desc);
$mfcdesc = stripslashes($mfcdesc);
$alternate = ($i % 2) + 1; ?>
<tr>
<td width="107" align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-left:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate
</td>
<td align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate
</td>
<td align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate
</td>
<? if ($m == 1) { ?>
<td width="211" align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate
</td>
<? } ?>
<? if ($pr == 1){ ?>
<td width="97" align="right" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate
</td>
<? } ?>
<? if ($u == 1) { ?>
<td align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate
</td>
<? } ?>
<? if ($w == 1){ ?>
<td width="116" align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate
</td>
<? } ?>
<? if ($ma == 1){ ?>
<td width="100" align="right" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate
</td>
<? } ?>
<? if ($mc == 1){ ?>
<td width="106" align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate
</td>
<? } ?>
<? if ($pi == 1){ ?>
<td width="106" align="left" valign="top" style="border-bottom:1px dotted #cccccc; border-right:1px dotted #cccccc;" class="altrow<?=$alternate
</td>
<? } ?>
</tr>
<? } ?>
</table>
<? }
/*++++++++++++++++++++++++
Use a code library like ezPDF to create pdf files out of the pages to be printed. In this way, you can control the sizes of the text and layout directly which will allow you to extrapolate the exact size of the page and maintain uniformity despite the local system settings. This does have the drawback of requiring a pdf viewer, but these are readily available for free these days for pretty much all current operating systems. This is realistically about the only way to directly control the sizes properly. I've seen attempts made via css in html output, but at best it works about 90% of the time as even if you set the sizes for everything, that doesn't mean they'll actually come out that size on the other end because of factors like print resolution and such.
ASKER
I've tried the ezPDF approach but I can't seem to grasp the concept of the code required. That and I don't think it was installed correctly on my server by my host (I actually had them install it). Any thoughts?
You're probably going to barf, but here's a solution that worked. Use MS Word as the rendering engine. (I suppose you can use OOorg as well.)
First, I created a table in HTML, and opened it in MS Word. Then I altered it by telling word to show the header line on every page. Also, make sure your header is tagged with THEAD and TH instead of TR and TD. It doesn't really matter, but, it's good form.
Second, save out the file as a web page. Then, use that web page as an output template.
Alter the Content-type of the page to be ms word. We're going to product MS Word compatible HTML file.
Here it is. Note that MS Word table lines are numbered: <tr style='mso-yfti-irow:<?php echo $i?>'>
<?php
header("Content-type: application/msword");
?>
<html xmlns:o="urn:schemas-micro soft-com:o ffice:offi ce"
xmlns:w="urn:schemas-micro soft-com:o ffice:word "
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 11">
<meta name=Originator content="Microsoft Word 11">
<link rel=File-List href="test.php-1_files/fil elist.xml" >
<title>col1</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>HP Authorized Customer</o:Author>
<o:LastAuthor>HP Authorized Customer</o:LastAuthor>
<o:Revision>2</o:Revision>
<o:TotalTime>1</o:TotalTim e>
<o:Created>2006-12-06T02:1 0:00Z</o:C reated>
<o:LastSaved>2006-12-06T02 :10:00Z</o :LastSaved >
<o:Pages>1</o:Pages>
<o:Words>150</o:Words>
<o:Characters>857</o:Chara cters>
<o:Company> </o:Company>
<o:Lines>7</o:Lines>
<o:Paragraphs>2</o:Paragra phs>
<o:CharactersWithSpaces>10 05</o:Char actersWith Spaces>
<o:Version>11.8036</o:Vers ion>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Print</w:View>
<w:GrammarState>Clean</w:G rammarStat e>
<w:ValidateAgainstSchemas/ >
<w:SaveIfXMLInvalid>false< /w:SaveIfX MLInvalid>
<w:IgnoreMixedContent>fals e</w:Ignor eMixedCont ent>
<w:AlwaysShowPlaceholderTe xt>false</ w:AlwaysSh owPlacehol derText>
<w:BrowserLevel>MicrosoftI nternetExp lorer4</w: BrowserLev el>
</w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orpha n;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"T imes New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.00 01pt;
mso-pagination:widow-orpha n;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400 ;
mso-bidi-language:#0400;}
</style>
<![endif]-->
</head>
<body lang=EN-US style='tab-interval:.5in'>
<div class=Section1>
<table>
<thead>
<tr style='mso-yfti-irow:0;mso -yfti-firs trow:yes'>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><b>col1<o: p></o:p></ b></p>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><b>col2<o: p></o:p></ b></p>
</td>
</tr>
</thead>
<?php for($i=1;$i<200;$i++) { ?>
<tr style='mso-yfti-irow:<?php echo $i?>'>
<td style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal>1</p>
</td>
<td style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal>2</p>
</td>
</tr>
<?php } ?>
</table>
</div>
</body>
</html>
First, I created a table in HTML, and opened it in MS Word. Then I altered it by telling word to show the header line on every page. Also, make sure your header is tagged with THEAD and TH instead of TR and TD. It doesn't really matter, but, it's good form.
Second, save out the file as a web page. Then, use that web page as an output template.
Alter the Content-type of the page to be ms word. We're going to product MS Word compatible HTML file.
Here it is. Note that MS Word table lines are numbered: <tr style='mso-yfti-irow:<?php
<?php
header("Content-type: application/msword");
?>
<html xmlns:o="urn:schemas-micro
xmlns:w="urn:schemas-micro
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 11">
<meta name=Originator content="Microsoft Word 11">
<link rel=File-List href="test.php-1_files/fil
<title>col1</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>HP Authorized Customer</o:Author>
<o:LastAuthor>HP Authorized Customer</o:LastAuthor>
<o:Revision>2</o:Revision>
<o:TotalTime>1</o:TotalTim
<o:Created>2006-12-06T02:1
<o:LastSaved>2006-12-06T02
<o:Pages>1</o:Pages>
<o:Words>150</o:Words>
<o:Characters>857</o:Chara
<o:Company> </o:Company>
<o:Lines>7</o:Lines>
<o:Paragraphs>2</o:Paragra
<o:CharactersWithSpaces>10
<o:Version>11.8036</o:Vers
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Print</w:View>
<w:GrammarState>Clean</w:G
<w:ValidateAgainstSchemas/
<w:SaveIfXMLInvalid>false<
<w:IgnoreMixedContent>fals
<w:AlwaysShowPlaceholderTe
<w:BrowserLevel>MicrosoftI
</w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orpha
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"T
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.00
mso-pagination:widow-orpha
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400
mso-bidi-language:#0400;}
</style>
<![endif]-->
</head>
<body lang=EN-US style='tab-interval:.5in'>
<div class=Section1>
<table>
<thead>
<tr style='mso-yfti-irow:0;mso
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><b>col1<o:
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><b>col2<o:
</td>
</tr>
</thead>
<?php for($i=1;$i<200;$i++) { ?>
<tr style='mso-yfti-irow:<?php
<td style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal>1</p>
</td>
<td style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal>2</p>
</td>
</tr>
<?php } ?>
</table>
</div>
</body>
</html>
ASKER
JK: Could you or anyone else knowledgable in PHP to Word contact me at sterry @ kerrpumps.com? I think this may solve my problem but since I don't know the "Ways of Word" I'm getting a little lost. If you contact me I could really use precise help with the actual file. Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
My page code can be found at http://www.kerrpumps.com/reportcode.xps and the phpinfo for the domain can be found at http://www.kerrpumps.com/phpinfo.php
The exPDF page I wrote I deleted because I was getting nowhere. It wouldn't even create a blank page. I would LOVE to create PDFs but I'm a layman when it comes to the code for it. I've increased the points for this question if anyone can help me incorporate what I have into a PDF that can be switched between landscape and portrait and include the headers on every page. =-) (The headers ARE NOT dynamic. Only the rows are.)
Again, I can be reached at sterry @ kerrpumps.com if need be!
The exPDF page I wrote I deleted because I was getting nowhere. It wouldn't even create a blank page. I would LOVE to create PDFs but I'm a layman when it comes to the code for it. I've increased the points for this question if anyone can help me incorporate what I have into a PDF that can be switched between landscape and portrait and include the headers on every page. =-) (The headers ARE NOT dynamic. Only the rows are.)
Again, I can be reached at sterry @ kerrpumps.com if need be!
When I go to the url above(http://www.kerrpumps.com/reportcode.xps), all I get is a prompt to download the file and it's full of what looks to be compiled code. Either it's not being parsed properly on the server side or this isn't standard php. What exactly is that file supposed to be?
ASKER
You could use the fpdf library for output to pdf. It's very easy to use and is written in pure PHP so no server alterations needed.
http://www.fpdf.org/
http://www.fpdf.org/