This topic is locked
[SOLVED]

 Excel cant open

6/28/2017 12:23:31 PM
PHPRunner General questions
H
htmalbenur author

I am unable to open the excel file from the online databases. do you have an idea. thank you



jadachDevClub member 6/28/2017

Make sure you set the field as file under edit as and view as. I think it defaults to image.

H
htmalbenur author 6/28/2017

In local mode it works very well, but after the hosting it does not work.
thk for your help.

johnnlenon 6/28/2017

Possibly PHP ZipArchive Library is missing or disabled in your hosting.
Check this link

https://www.digitalo...ing-or-disabled

Excel2007.php:

{

// Check if zip class exists

if (!class_exists('ZipArchive')) {

return false;

}

...

$xl = false;

// Load file

$zip = new ZipArchive;

if ($zip->open($pFilename) === true) {

// check if it is an OOXML archive

$rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels"));

foreach ($rels->Relationship as $rel) {

switch ($rel["Type"]) {

...

}
Sergey Kornilov admin 6/28/2017

Also make sure that write permissions on templates_c folder.
More info:

https://xlinesoft.com/phprunner/docs/export_import_pages.htm

lefty 6/28/2017



Also make sure that write permissions on templates_c folder.
More info:

https://xlinesoft.co...mport_pages.htm


If it is an xls file go to control panel , go to programs and assign xls to excel. Then it will open . Just in case this is the issue.

H
htmalbenur author 6/29/2017

thx, but how I can use this code.



Possibly PHP ZipArchive Library is missing or disabled in your hosting.
Check this link

https://www.digitalo...ing-or-disabled

Excel2007.php:

{

// Check if zip class exists

if (!class_exists('ZipArchive')) {

return false;

}

...

$xl = false;

// Load file

$zip = new ZipArchive;

if ($zip->open($pFilename) === true) {

// check if it is an OOXML archive

$rels = simplexml_load_string($this->_getFromZipArchive($zip, "_rels/.rels"));

foreach ($rels->Relationship as $rel) {

switch ($rel["Type"]) {

...

}


johnnlenon 6/29/2017



thx, but how I can use this code.


This code is located inside the file

output\plugins\PHPExcel\Reader\Excel2007.php

.

I put it in the post to show that PHPRunner uses this library to export to Excel, however, you do not have to modify anything, what you can do is verify that your hosting has the ZipArchive PHP library Enabled.

Sergey Kornilov admin 6/29/2017

This is an example of correct but misleading answer. PHPRunner does use PHPExcel that does require ZIP extension in PHP but posting the code makes people think they need to use this code somewhere.

  1. Make sure that write permissions are set of template_c folder
  2. Make sure that ZIP extension is enabled in PHP settings.
    If it works locally and on Demo Account that means something is not right with web server configuration and this two things is what you need to check.

johnnlenon 6/29/2017



This is an example of correct but misleading answer. PHPRunner does use PHPExcel that does require ZIP extension in PHP but posting the code makes people think they need to use this code somewhere.

  1. Make sure that write permissions are set of template_c folder
  2. Make sure that ZIP extension is enabled in PHP settings.
    If it works locally and on Demo Account that means something is not right with web server configuration and this two things is what you need to check.



Sorry for the mistake in publishing the code, I just wanted to exemplify. I'll be careful next time.excuse me

H
htmalbenur author 7/3/2017

Super cool Mr Adm, I am ok with your process and the new version gives more possibility. thank you