|
Posted
almost 10 years
ago
by
MarkBaker
Classes/PHPExcel/Reader/HTML.php @ 429, (comma) instead of . (dot)throw new PHPExcel_Reader_Exception('Failed to load ',$pFilename,' as a DOM Document');should bethrow new PHPExcel_Reader_Exception('Failed to load '.$pFilename.' as a DOM
... [More]
Document');also you should use libxml_use_internal_errors(true); to get rid of warnings and get exceptions from libxml too.Comments: The official source repository for PHPExcel has been on [github](https://github.com/PHPOffice/PHPExcel/) for over two years now, and we do accept PRs [Less]
|
|
Posted
almost 10 years
ago
by
pu5htiu
Classes/PHPExcel/Reader/HTML.php @ 429, (comma) instead of . (dot)throw new PHPExcel_Reader_Exception('Failed to load ',$pFilename,' as a DOM Document');should bethrow new PHPExcel_Reader_Exception('Failed to load '.$pFilename.' as a DOM
... [More]
Document');also you should use libxml_use_internal_errors(true); to get rid of warnings and get exceptions from libxml too. [Less]
|
|
Posted
almost 10 years
ago
by
Tomlambro
Hello,
The documentation on the following page seems to be missing:
https://phpexcel.codeplex.com/wikipage?title=http://g-ernaelsten.developpez.com/tutoriels/excel2007/PHPExcel.pdf&referringTitle=Documents
I found the link on this page:
... [More]
https://phpexcel.codeplex.com/wikipage?title=Documents&referringTitle=Home
Can you look into fixing this page?
The actual link is the latter:
http://g-ernaelsten.developpez.com/tutoriels/excel2007/?page=introduction
Thank you.
Have a nice day,
[Less]
|
|
Posted
almost 10 years
ago
by
DucVo
OK. Didn't know that. I'm gonna try it. Thank you for your help!
|
|
Posted
almost 10 years
ago
by
MarkBaker
The ZipArchieve close() function is what actually writes the zip file that's being generated.
When it gives that error, it means that it s unable to create the zip. Typically this is a result of file permissions: the ZipArchive class is unable to
... [More]
create a zip file in the specified location, or a zip file of the same name already exists and is opened by some other process.
[Less]
|
|
Posted
almost 10 years
ago
by
DucVo
I always have the error 'PHPExcel_Writer_Exception' with message 'Could not close zip file' and I think, it's because of the ZipArchive close() function. When I looked at it, it was empty. I don't know why. Is it a bug or a feature?
|
|
Posted
almost 10 years
ago
by
Jeanjbf
I have this input file bootstrap:This input file only accept xls file, when I send the xls file, first I need check in php if the file is only read or not and return a specific number, because I need accept
... [More]
only editable files.Example what I need:I send a xls file, in php I check if is a editable file , if is editable file , continue with the next step, and if is not a editable file, return 3.This is a only read file:I work with phpexcel and when I send a only read file , I have the next error:This is my code in php:```<?phprequire "dao/daoExcel.php";require "vendor/autoload.php";class ControllerExcel { private $aDatosExcel; public function setDataExcel($dataexcel) { $estado = true; if($this->moverArchivo($dataexcel)==false){ $estado = false; } if($estado == true && $this->validaHeaders($dataexcel)==false){ $estado = false; return 2; } if($estado == true){ return $this->setInsertExcel($dataexcel); } } public function moverArchivo($dataexcel) { $fileName = $_FILES["archivo"]["name"]; $fileTmpLoc = $_FILES["archivo"]["tmp_name"]; $aHeader = new DaoExcel(); $excelUrl = $aHeader->getHeaderExel($dataexcel); $pathAndName = $excelUrl[17]['par_valor'].$fileName; $moveResult = move_uploaded_file($fileTmpLoc, $pathAndName); if ($moveResult == true) { return true; }else{ return false; } } public function validaHeaders($dataexcel){ $inputFileType = 'Excel5'; $aHeader = new DaoExcel(); $excelHead = $aHeader->getHeaderExel($dataexcel); $inputFileName = $excelHead[17]['par_valor'].$_FILES["archivo"]["name"]; $objReader = PHPExcel_IOFactory::createReader($inputFileType); $objPHPExcel = $objReader->load($inputFileName); $h1 = $objPHPExcel->getActiveSheet()->getCell('A1')->getValue(); $h2 = $objPHPExcel->getActiveSheet()->getCell('B1')->getValue(); $h3 = $objPHPExcel->getActiveSheet()->getCell('C1')->getValue(); $h4 = $objPHPExcel->getActiveSheet()->getCell('D1')->getValue(); $h5 = $objPHPExcel->getActiveSheet()->getCell('E1')->getValue(); $header = $h1."###".$h2."###".$h3."###".$h4."###".$h5; if($excelHead[16]['par_valor'] == $header){ return true; }else{ return false; } } public function setInsertExcel($dataexcel){ $inputFileType = 'Excel5'; $aHeader = new DaoExcel(); $excelHead = $aHeader->getHeaderExel($dataexcel); $inputFileName = $excelHead[17]['par_valor'].$_FILES["archivo"]["name"]; $objReader = PHPExcel_IOFactory::createReader($inputFileType); $objPHPExcel = $objReader->load($inputFileName); $contRows = $objPHPExcel->setActiveSheetIndex(0)->getHighestRow(); for($i=2;$i<=$contRows;$i++){ $h1 = $objPHPExcel->getActiveSheet()->getCell('A'.$i)->getValue(); $h2 = $objPHPExcel->getActiveSheet()->getCell('B'.$i)->getValue(); $h3 = $objPHPExcel->getActiveSheet()->getCell('C'.$i)->getValue(); $h4 = $objPHPExcel->getActiveSheet()->getCell('D'.$i)->getValue(); $h5 = $objPHPExcel->getActiveSheet()->getCell('E'.$i)->getValue(); $aDatos['ac_no']=$h1; $aDatos['custom_no']=$h2; $aDatos['nombre']=$h3; $aDatos['marc']=$h4; $aDatos['estado']=$h5; $aDatos['fecha_registro']=$this->setFecha(); $aDatos['rco_oculto']=0; $this->aDatosExcel[]=$aDatos; } return $aHeader->insertDatosExcel($this->aDatosExcel); } private function setFecha(){ date_default_timezone_set("America/Santiago"); $now = time(); putenv("TZ=America/Santiago"); $fecha=date("Y-m-d H:i:s",$now); $date=date("Y/m/d H:i:s", strtotime($fecha)); return $date; }}?>```So I see that by default,phpexcel only accept editable files , but how can I check by my self if a xls file is only read or not with phpexcel , and return a message?Sorry by my english. [Less]
|
|
Posted
almost 10 years
ago
by
azimk2
I am creating excel sheet using php, it worked but saved directly on local, and I don't want to save on local but on server directory how can I do that ?Comments: ** Comment from web user: azimk2 ** @MarkBaker Thank you very much, now I am able to do what I wanted.
|
|
Posted
almost 10 years
ago
by
MarkBaker
I am creating excel sheet using php, it worked but saved directly on local, and I don't want to save on local but on server directory how can I do that ?Comments: This isn't an issue with PHPExcel, it's an issue with the poster not having an understanding of how the interweb works
|
|
Posted
almost 10 years
ago
by
MarkBaker
I am creating excel sheet using php, it worked but saved directly on local, and I don't want to save on local but on server directory how can I do that ?Comments: ** Comment from web user: MarkBaker ** `$objWriter->save('php://output');` is
... [More]
telling PHPExcel to send the output to the browser..... that's what `php://output` is..... Those `header()` lines are telling the browser that you're about to send it an Excel file..... so of course it gets sent to the browser.If you don't want to send the file to the web browser, then remove all those `header()` lines, and use `$objWriter->save('/path/to/where/I/want/the/file/to/be/saved/on/the/webserver.xlsx');` [Less]
|