Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-19-2007, 06:12 PM   PM User | #1
CstAn
Regular Coder

 
Join Date: Nov 2005
Posts: 148
Thanks: 1
Thanked 0 Times in 0 Posts
CstAn is an unknown quantity at this point
excel display problem for different version of microsoft office.

Dear All,

i had developed an export data to excel function, but they have some problem with cross version of Microsoft office.
Question:
How can i display the integer as string in excel (without any setting, with default setting)?
isn't all version of office support same ascii code?

this my coding:
header("Content-type: application/x-msexcel");
header("Content-Disposition: attachment; filename=\"frtInvSummaryReport_".date('dmY').".xls\"");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");

$SEPARATOR = "\t";

$title = "FWDR DO{$SEPARATOR}Frt Invoice #{$SEPARATOR}MAWB #{$SEPARATOR}HAWB #{$SEPARATOR}Project Code{$SEPARATOR}Received Date(ESEA) (DD/MM/YYYY){$SEPARATOR}Frt Inv(SGD)\n";

//some process here

echo $header;
echo $title;
echo $content;


I m using PHP to export the data to excel file.
Problem:
With this function, i able to generate a excel file but it were some display problem in the excel file for different version of office. For example, it will auto reduce the '0(zero)' after the ".(dot)". This one of things i don't want.

to solve the problem upper, i add in new space with ascii code (chr(255)) but problem is, it not support by old version (97/2000) office.
It display other character on old version but display empty space at new version (2003)

thanks.

Last edited by CstAn; 07-19-2007 at 06:15 PM..
CstAn is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:35 AM.


Advertisement
Log in to turn off these ads.