PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, August 30, 2022

[FIXED] How to adjust width of cells so they do not cut words in Spreadsheet_Excel_Writer

 August 30, 2022     excel, export-to-excel, pear, php     No comments   

Issue

I am trying to create an Excel sheet using the Spreadsheet_Excel_Writer that comes with Pear.
The sheet is created, and all is OK, Except, My words are being cut and the cells does not adjust their width to accommodate complete words.
I try to open it with Office 2007.
What values do I have to put into the Spreadsheet_Excel_Writer_Format object for that?


Solution

I don't believe you can do this with S_E_W. It would be nice if it had the equivalent of Excel's "fit auto" for column/row widths/heights, but it doesn't - you can only set a column to a specific width with $worksheet->setColumn().

You may want to investigate switching to PHPExcel. It's still under active development and supports the newest Excel file formats, as well as a more complete API. S_E_W is essentially dead in the water and shoul be considered abandonware now.



Answered By - Marc B
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing