D
D
Dima2014-01-15 11:39:52
1C-Bitrix
Dima, 2014-01-15 11:39:52

Working PhpExcel with Bitrix

Good afternoon. I'm having a problem getting excel5 (.xls, Excel 2003) working through PhpExcel. And Excel2007 and CSV work fine.
When reading .xls files, it gives an error:
ErrorException [ Notice ]: Uninitialized string offset: 339
At some point, $data of zero length is sent to the function _GetInt4d($data, $pos) function, the reason could not be found out. In Google I found a couple of solutions related to the server configuration:
mbstring.func_overload 0
mbstring.internal_encoding=ISO-8859-1
But these parameters are important for Bitrix operation (cannot be changed).
The customer wanted my system to be located on the same hosting with Bitrix, just in a separate folder. The system is written in Kohana.
Tried to use PHP Excel Reader class. Outputs the following error:
The filename /var/www/vhosts/test89.ru/httpdocs/parser/Upload/mailexcel/SB.xls is not readable Fails
validation: if (substr($this->data, 0, 8) != IDENTIFIER_OLE)
Comparison in the browser also did not match.
If you comment on this check, it outputs:
ErrorException [ Notice ]: Undefined property: OLERead::$wrkbook
If you disable error reporting, then there is no answer.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Grigory Peretyaka, 2014-01-15
@Peretyaka

Does it work locally/on another server? You can use ini_set to change the parameters before the script is executed and return them after, like so:
ini_set('mbstring.internal_encoding', 'UTF-8');
Well, are you aware that PhpExcel is for very small files? For larger ones, it is better to use the LibreOffice API.

D
Dima, 2014-01-15
Raduk @DimaRaduck91

On localhost everything works fine.
ini_set('mbstring.internal_encoding', 'UTF-8'); doesn't work with PHP 5.2 version, with .htaccess also.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question