0

need some help with phpexcel.

I'm getting data from myslq and populating an xlsx, but there's a field on db "observations" which usually have a tiny text... Obviously when I try to print the xlsx, it will print like 3/4 papers.

Is there any way to program the document to break line when cells characters reach the limit of document margin?

example of the problem

Can't find this answer anywhere :O

Best regards and thanks

EDIT #1

for eg: A B xxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

This document will print 2 papers, is there any way to fix width of the sheet, to workaround this problem? I want that the column B text be like: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx to

xxxxxxxxx xxxxx

hhelderneves
  • 925
  • 8
  • 24
  • How would you do it in MS Excel? If you can't then there's no way you can do it in PHPExcel.... but I'd recommend setting the cell to wrap the text – Mark Baker Sep 11 '17 at 15:55
  • Possible duplicate of [PHPExcel auto size column width](https://stackoverflow.com/questions/16761897/phpexcel-auto-size-column-width) – siniradam Sep 11 '17 at 15:56
  • @MarkBaker, i'm using libreoffice and office 2013. – hhelderneves Sep 11 '17 at 15:59
  • @Siniradam No, because this will only autosize the column. It's isn't my problem, since I already have this in my code ;) – hhelderneves Sep 11 '17 at 15:59
  • So tell me how you would do it in libreoffice and/or office 2013! But PHPExcel can't do magic that MS Excel can't – Mark Baker Sep 11 '17 at 15:59
  • If I get the question right, you can get column width if it is exceeds your limit then you can overwrite width. You should be able to find the code in that topic. – siniradam Sep 11 '17 at 16:01
  • If I know I won't be asking :D I that there's isn't magic, just a question to know If its possible ;) – hhelderneves Sep 11 '17 at 16:02
  • Well the possibility is that both MS Excel and PHPExcel support autowrap in cell content, and autoheight for row – Mark Baker Sep 11 '17 at 18:01

0 Answers0