10
I Use This!
Inactive

News

Analyzed about 22 hours ago. based on code collected about 22 hours ago.
Posted over 10 years ago by Poornimapriya
I have wrote the following code to read from excel. Then added an image to the excel file via PHPExcel_Worksheet_Drawing. But its not showing the image in the pdf. ```$objPHPExcel = new PHPExcel();$inputFileType ... [More] =PHPExcel_IOFactory::identify('C:\Users\poornimapriya.s\Desktop\sample.xls');$objReader = PHPExcel_IOFactory::createReader($inputFileType);$objPHPExcel = $objReader->load('C:\Users\poornimapriya.s\Desktop\sample.xls');$objDrawing = new PHPExcel_Worksheet_Drawing();$objDrawing->setName('Logo');$objDrawing->setDescription('Logo');$objDrawing->setPath('C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg');$objDrawing->setOffsetX(0);$objDrawing->setOffsetY(300);$objDrawing->setCoordinates('F13');$objDrawing->setHeight(75); // logo height$objDrawing->setWorksheet($objPHPExcel->getActiveSheet());$objWriter1 = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter1->save('C:\Users\poornimapriya.s\Desktop\sample1.xls');$objPHPExcel = $objReader->load('C:\Users\poornimapriya.s\Desktop\sample1.xls');$objWriter = new PHPExcel_Writer_PDF($objPHPExcel);$objWriter->setSheetIndex(0);$objWriter->save("C:\Users\poornimapriya.s\Desktop\sample.pdf");```Changed the code for the image writer but still its not converting to image since the instance of the image is not deducted as PHPExcel_Worksheet_Drawing rather as PHPExcel_Worksheet_MemoryDrawing.Please help on this to fix the issue. [Less]
Posted over 10 years ago by ctm002
My track is it PHPExcel_Shared_String PHPExcel_Calculation PHPExcel_Calculation_Function PHPExcel_CalcEngine_CyclicReferenceStack PHPExcel_CalcEngine_Logger PHPExcel_Worksheet Fatal error: Class 'PHPExcel_Worksheet' not found in /var/www/html/Barracuda/Developed/Classes/PHPExcel.php on line 364
Posted over 10 years ago by ctm002
I need that help me with it problem. Fatal error: Class 'PHPExcel_Worksheet' not found my autoloader is by default PHPExcel_Autoloader::Register(); public static function Register() { if (function_exists('__autoload')) { // ... [More] Register any existing autoloader function with SPL, so we don't get any clashes spl_autoload_register('__autoload'); } // Register ourselves with SPL return spl_autoload_register(array('PHPExcel_Autoloader', 'Load')); } public static function Load($pClassName){ if ((class_exists($pClassName,FALSE)) || (strpos($pClassName, 'PHPExcel') !== 0)) { // Either already loaded, or not a PHPExcel class request return FALSE; } $pClassFilePath = PHPEXCEL_ROOT . str_replace('_',DIRECTORY_SEPARATOR,$pClassName) . '.php'; if ((file_exists($pClassFilePath) === FALSE) || (is_readable($pClassFilePath) === FALSE)) { // Can't load return FALSE; } require($pClassFilePath); } any help would be welcome thank [Less]
Posted over 10 years ago by Nalianne
Please, I really need this to work, could you help me?
Posted over 10 years ago by qazihamayun
I want to export HTML(with CSS styling) to EXCEL sheet, for now I am using the PHPExcel library to perform this, it generate the excel file but remove the CSS (using inline with html tags), please guide me, that how to keep CSS in excel sheet.I am ... [More] using this code, But I also want to keep the css that should apply on exported excel sheet```//html$html = "<table> <thead> <tr> <td colspan='2'> <h1> Main Heading </h1> <td> </tr> </thead><tbody><tr> <th style='background:#ccc; color:red; font-size:15px'> Name <th> <th style='background:#ccc; color:red; font-size:15px'> Class <th> </tr> <tr> <td style='background:#fff; color:green; font-size:13px'> Jhon <th> <td style='background:#fff; color:gree; font-size:13px'> 9th <th> </tr> </tbody></table>";// Put the html into a temporary file$tmpfile = time().'.html';file_put_contents($tmpfile, $html);// Read the contents of the file into PHPExcel Reader class$reader = new PHPExcel_Reader_HTML; $content = $reader->load($tmpfile); // Pass to writer and output as needed$objWriter = PHPExcel_IOFactory::createWriter($content, 'Excel2007');$objWriter->save('excelfile.xlsx');// Delete temporary fileunlink($tmpfile);``` [Less]
Posted over 10 years ago by jocker711
Hello. I use PHPExcel, gives an error: Multibyte function overloading in PHP must be disabled for string functions (2). You can work around the problem, if the file to comment out Autoloader.php: 34 string "throw new PHPExcel_Exception ('Multibyte ... [More] function overloading in PHP must be disabled for string functions (2).');". What is the consequence for me this way? How can I fix the problem anyway? Search the Internet has led to the fact that you need to change php_value mbstring.func_overload, but there is no way to do it. PHP Version 5.3.3-7+squeeze17 Linux ds143 2.6.32 Thank you for your help. [Less]
Posted over 10 years ago by fe2high
Hi There, I have managed to get PHPExcel working but I have a couple of issues. My XLS spreadsheet has 7 columns but my MySQL Table has 8 it has an ID column so when I import to it my data is out of sync with the columns. How do i add a dummy ... [More] field in the INSERT INTO statement? Also do I really need to know how many rows are in my XLS spreadsheet? I am exporting my XLS from another application and the amount of rows is continually growing. Regards Iron [Less]
Posted over 10 years ago by CassandraLAB
Indeed, apparently the value in my array ($reporte->result()) was wrong, so I casted the value from the stored procedure that generates it (as "CAST(Tipo AS CHAR CHARACTER SET utf8) AS Tipo") and there is no more encoded needed and that solved my problem. Thank you.
Posted over 10 years ago by MarkBaker
The problem is likely to arise in utf8_encode($fila->Tipo). If utf8_encode() fails, then it will return a value of false
Posted over 10 years ago by CassandraLAB
I've got some issues when setting cells with special characters (as á, é, í, etc.). If I do it directly with "setCellValue" it's ok, but when I'm trying to do it with the function "fromArray" it sets the cell as "FALSE". My array is defined this ... [More] way: foreach ($reporte->result() as $fila) { $datosReporte[] = array( 'Fecha' => $fila->NombreDia." ".$fila->Fecha, 'Horario' => $fila->HoraEntrada." - ".$fila->HoraSalida, 'Entrada' => $fila->ChecadaEntrada, 'Salida' => $fila->ChecadaSalida, 'Incidencia' => utf8_encode($fila->Tipo) ); } So the value "Incidencia", which is the one I have problems with, is already encoded. I have also checked the file encoding in Sublime Text 2 and it shows UTF-8 as well. Any ideas what might be the problem? [Less]