473,395 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

<font size="-1">

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.

Jun 13 '07 #1
0 1077

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.