View Full Version : new line in excel file-- urgent

08-30-2006, 03:37 PM
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??


08-30-2006, 04:26 PM
You can go old school, hit the space bar until the text drops down :p

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

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

09-04-2006, 03:10 PM
i try "\n" but not "\r"....

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

09-04-2006, 03:45 PM
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.

09-04-2006, 04:17 PM
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 :confused: