This topic is locked
[SOLVED]

 include phpecxel in custom page

2/24/2019 4:37:17 AM
PHPRunner General questions
T
tisento author

Hello,
i'm pretty new to phprunner. Though i searched, i could not find any satisfying answer.
i created a small project with custom pages from another non-phprunner project for import/read and export/write excel sheets. i included "my own" phpexcel from the projects source folder. Erverything works fine.
But while upgrading to phprunner 10.1 i saw, that in the windows/programms folder of phprunner, there is a phpexcel version already.
So here are my questions:

  1. Do i need a "own" phpexcel in my projects source foulder to include in phprunner projects? If yes, see my question nr. 3.
  2. if no, how can i include phpexcel from windows/programms folder - for example: require once ... or require ... path ...
  3. which version of phpexcel/office is use by phprunner? Is it possible meanwhile using phpspreadsheet from phpoffice?
    Thanks for any help or suggestion!

Sergey Kornilov admin 2/24/2019
T
tisento author 2/27/2019

I did, what the link says:
i added to "Before process"-Event:

require('PHPExcel.php');
I downloaded: php_zip.dll for php7
I unpacked it to the servers folder ext, as this is the extension_dir = "C:\xampp703\php\ext" on my windows xampp

i added in the php.ini: extension=php_zip.dll
i restarted the server and got the following error: Fatal error: require(): Failed opening required 'PHPExcel.php' (include_path='C:\xampp703\php\PEAR')
So somehow, there must be somethin wrong.
What i want is, to use the build in phpexcel from phprunner instead of using another phpexcel,included like an extern library in the projects source folder. The extern inclusion works, but i want to use the phprunner's phpexcel. Because the buildin version is tested and will be update by phprunner.
Thanks.

Sergey Kornilov admin 2/27/2019

Change the path to include PHPExcel.php file that comes with PHPRunner? You can see where in the output folder it is located and adjust the path accordingly.

T
tisento author 3/1/2019

Thanks a lot,
works perfect.
But first i made another mistake: a leading backslash in pathname does not work!
My correct code in "before process" event is:

require_once ('plugins/PHPExcel.php');
T
tisento author 3/1/2019

Sorry,

problem not solved.
Obviously most of build-in phpexcel functions an methods seem to work with my custom script, but there are still some problems:

Call to undefined method PHPExcel_Worksheet::rangeToArray()


Using "my" old phpexcel version, erverythings fine.
What is the built-in version of phprunner? Maybe this is the reason for the undefined method. "My" version is the last published of phpexcel 1.80

Sergey Kornilov admin 3/1/2019

I guess you cannot use a built-in version of PHPExcel in this case and need to use your own.