• You are not logged in. | Login

Post a reply

  • Index
  •  » Help me!
  •  » Trouble when working with Spreadsheet Excel writer

March 21, 2007 1:24 pm

stp2233
Member
Ranks

Trouble when working with Spreadsheet Excel writer

I’m working with this library and I’ve faced following problem: text data with size more than 256 symbols are cut off when inserted into the cell. Can someone tell me how to omit this?

Last edited by stp2233 (March 21, 2007 1:25 pm)


 

 

March 21, 2007 1:28 pm

Re: Trouble when working with Spreadsheet Excel writer

Solution may be following (as for me, this variant rather implies questions than gives answers).

If you apply following method
$workbook->setVersion(8);
You will be able to record long strings by means of $worksheet->writeString()

But after that coding problems appeared which I haven’t solved yet. By attempt to recode or set up $worksheet-->setInputEncoding() the picture that is typical for me now is “file has been damaged so seriously that its reconstruction is impossible”.

I would be very thankful if someone has any ideas concerning the thread.

The problem is similar to the one described here
http://pear.php.net/bugs/bug.php?id=1805.

But the variants of its solution don’t work…


 

 

March 21, 2007 1:32 pm

steven9x
Member
Ranks

Re: Trouble when working with Spreadsheet Excel writer

I have a similar problem. Has anyone succeed in omitting it?


 

 

March 21, 2007 1:37 pm

Stre@m
Member
Ranks

Re: Trouble when working with Spreadsheet Excel writer

Generally speaking, this problem is partially solved.
First you are to link up php_iconv.dll library in the unit Extensions of php.ini file. Generally it was enough for me but I’ve found one more way just in case:

1. $workbook->setVersion(8);

2. $worksheet->setInputEncoding('CP1251');

3. In Spreadsheet/Excel/writer.php after the line 67 (method send())
we write
header("Content-Encoding: windows-1251");

4. Spreadsheet/Excel/writer/Workbook.php:200 correct
$this->_codepage = 1200 // FIXME: should change for BIFF8

5. Spreadsheet/Excel/writer/Workbook.php:1445 correct
$encoding = 1; // assume there are no Unicode strings

But! File size now can be no more than < ~8224kb
Maybe someone has got something better?


 

 

July 25, 2007 5:51 pm

spylee
Member
Ranks

Re: Trouble when working with Spreadsheet Excel writer

Now there's a better solution! smile

Assuming you've got 0.9.0 or greater, you can copy in the fix from Michal Frapo and it'll work nicely.


 

 
  • Index
  •  » Help me!
  •  » Trouble when working with Spreadsheet Excel writer
  • Actions
  • Top
ITCrimea. Ukraine Web Development Company. Professional Developers and Web Designers Team
Custom Web Designs, Internet Applications, E-Commerce Websites, Interactive Sites, Database-Driven Sites and Services