Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    148
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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 07:15 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •