Current location: Hot Scripts Forums » Programming Languages » PHP » writing Excel files through PHP


writing Excel files through PHP

Reply
  #1 (permalink)  
Old 09-26-03, 01:01 PM
pk_jsp pk_jsp is offline
Newbie Coder
 
Join Date: Sep 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
writing Excel files through PHP

I have to generate reports in Excel formats.I send the appropriate content type through header() function of PHP.But I can't get the <td> colors when using css sheets.
echo "<tr><td align='center' class='graybg'>$name</td></tr>";
Neither the data is aligned center nor the bgcolor becomes gray as defined in css..

Can anybody help me for that?

Prashant Dubey
Reply With Quote
  #2 (permalink)  
Old 09-26-03, 04:30 PM
YourPHPPro's Avatar
YourPHPPro YourPHPPro is offline
Community VIP
 
Join Date: Aug 2003
Posts: 430
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by pk_jsp
Can anybody help me for that?
Can you show us the script you are running ?
Reply With Quote
  #3 (permalink)  
Old 09-26-03, 10:28 PM
the|Skrilla the|Skrilla is offline
Newbie Coder
 
Join Date: Jun 2003
Location: Louisiana, USA
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
I don't think excel understands CSS. You'll have to use the bgcolor parameter
__________________
Lead Level Designer - Liquid Element
Reply With Quote
  #4 (permalink)  
Old 09-27-03, 05:21 AM
pk_jsp pk_jsp is offline
Newbie Coder
 
Join Date: Sep 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Below id the relevant part of the script.
Following problem occurs:
1. Image doesn't come.
2.<td> does'nt take css style.

<?php

header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename=pareto_combined.xls");
?>
<link href="../../../extra/sheets/SSheet.css" rel="stylesheet" type="text/css">
<tr colspan=8>
<td height=50> <img src='../../../extra/images/log.jpg'></td>
<td align=right><img src='../../../extra/images/mickey_sup.jpg'></td>
</tr>

<?php
$dateF=$_REQUEST['dateF'];

$dateT=$_REQUEST['dateT'];

$agentID=$_REQUEST['agentID'];
<tr>
<td class='graybg'><?php echo $agentID</td>
<td class='graybg'><?php echo $dateF</td>
<td class='graybg'><?php echo $dateT</td>
</tr>

Prashant
Reply With Quote
  #5 (permalink)  
Old 09-28-03, 05:42 AM
ermau's Avatar
ermau ermau is offline
Wannabe Coder
 
Join Date: Aug 2003
Location: Florida, USA
Posts: 240
Thanks: 0
Thanked 0 Times in 0 Posts
Maybe excel doesn't accept CSS styles, but just html's <td> most certainly does, I can't think of a single tag that doesn't.
__________________
PHP / mySQL Developer
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
PHP Dudes - Hi All stuart New Members & Introductions 4 05-03-04 01:22 PM
one-page form/catalog in php, data fed in with .csv file? domaky PHP 2 10-25-03 09:32 AM
PHP Triad/Upload form eddyvlad PHP 6 10-06-03 11:17 PM
Form to Excel markpilkinton Script Requests 1 07-11-03 04:17 PM


All times are GMT -5. The time now is 06:19 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.