|
Posted by teser3@hotmail.com on 06/13/07 23:36
I can put out a Word Doc from PHP but if I try and manipulate the font
size in the PHP part it outputs a blank Word Document.
Here is what I have:
<?php
$fname="report.doc";
$handle = fopen( $fname, "rb" );
$buf = fread( $handle, filesize( $fname ));
fclose( $handle );
$len = strlen( $buf );
header( "Pragma: public" );
header( "Cache-Control: private" );
header( "Connection: close" );
header( "Content-Type: application/msword" );
header( "Content-Length: $len" );
header( "Content-Disposition: inline; filename=\"$fname\"" );
print $buf;
>
<table border="1">
<tr>
<td>FieldOneHeader</td>
<td>FieldTwoHeader</td>
<td>FieldThreeHeader</td>
....
<td>FieldTenHeader</td>
</tr>
<?php
//Oracle DB Connection username and password etc here
$s = OCIParse($connection. "select * from theTable");
OCIExecute($s, OCI_DEFAULT);
while (OCIFetch($s)) {
print '<tr><td><font size="-1">' . ociresult($s, "FIELDONENAME") .
'</font></td>';
print '<td><font size="-1">' . ociresult($s, "FIELDTWONAME"). '</
font></td>';
print '<td><font size="-1">' . ociresult($s, "FIELDTHREENAME"). '</
font></td>';
print '<td><font size="-1">' . ociresult($s, "FIELDFOURNAME"). '</
font></td>';
print '<td><font size="-1">' . ociresult($s, "FIELDFIVENAME"). '</
font></td>';
//rest here .......
print '<td><font size="-1">' . ociresult($s, "FIELDNINENAME"). '</
font></td>';
print '<td><font size="-1">' . ociresult($s, "FIELDTENNAME"). '</
font></td></tr>';
}
print '</table>';
?>
The wierd part is if I only put font size in the first 5 fields it
will work:
print '<tr><td><font size="-1">' . ociresult($s, "FIELDONENAME") .
'</font></td>';
print '<td><font size="-1">' . ociresult($s, "FIELDTWONAME"). '</
font></td>';
print '<td><font size="-1">' . ociresult($s, "FIELDTHREENAME"). '</
font></td>';
print '<td><font size="-1">' . ociresult($s, "FIELDFOURNAME"). '</
font></td>';
print '<td><font size="-1">' . ociresult($s, "FIELDFIVENAME"). '</
font></td>';
//rest here .......
print '<td>' . ociresult($s, "FIELDNINENAME"). '</td>';
print '<td>' . ociresult($s, "FIELDTENNAME"). '</td></tr>';
Please advise.
Navigation:
[Reply to this message]
|