Hi to everyone here, this is my first post. I ran into a problem I can't find a solution for, so I decided to write, hope it's a piece of cake for many of you...

I'd like to make a line break in an exported excel worksheet. I am using Spreadsheet::WriteExcel by Xavier Noguer, this is what came with the local intranet I'm working on. I get all data exported fine, the problem is with linebreaks inside cells.

I have some html like this: $html="foo1<br>line2<br>line3";
Then replace the "<br>"'s with "\n" and in excel I get "foo1&#8962;line2&#8962;line3". If I click this cell, start editing it and press enter, the &#8962;'s disappear and the cell looks good. How could I automatically "press enter" in the excel worksheet, via php?

Thanks much
Waire

$worksheet1->write_string($i, $count, strip_tags(str_replace("<br>", "\n", $this->query_field_gen($field["field_name"], $row[$field["field_name"]], $field["format"], $row, $this->queryname, "", "simple"))));

    I attached 2 pics for clarification. I hope someone could help me out, I've spent about 5 hours trying to figure this out and I should already be working on other stuff. 🙁
    Any help (different excel writer class maybe?) much appreciated, thanks again.

      Write a Reply...