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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    148
    Thanks
    1
    Thanked 0 Times in 0 Posts

    new line in excel file-- urgent

    header("Content-type: application/octet-stream");
    header("Content-Disposition: attachment; filename=excelfile.xls");
    header("Pragma: no-cache");
    header("Expires: 0");
    i had created an excel file by set the header.

    now my problem is how can i go to new line in one column???

    i had using tag "<br />" but it go to next row with same column..

    but now my supervisor required to set it to new line in same column..


    how can i set it??

    thanks.

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    You can go old school, hit the space bar until the text drops down

    That was an inside joke. People and their formatting techniques can crack you up.

    ANYWAY.... did you try "\n" or "\r"?

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    148
    Thanks
    1
    Thanked 0 Times in 0 Posts
    i try "\n" but not "\r"....

    what mean by "\r"?? same as "\n"??

  • #4
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    Cant be done afaik.
    If you open up excel and try to put a new line in a cell, it cant be done. If you press return then you go to the next cell, same if you paste in text with new lines in it.
    Tabs go to the next cell in the current row and newlines go to the next cell in the current column.

  • #5
    New Coder
    Join Date
    Aug 2006
    Location
    UK
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try hitting ALT + Enter when in Excel, I think that inserts a new line.

    Not sure how you go about generating Excel spreadsheets from PHP though


  •  

    Posting Permissions

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