dsr Posted April 10, 2013 Share Posted April 10, 2013 (edited) Hi all This is DSR(PHP novice) from India and i am stuk in a probelm.. Is it possible to export images from folder to excel file using php? if possible then please show me the way. Regards DSR (I am a little bit confushed about posting in the right place) Edited April 10, 2013 by dsr Quote Link to comment Share on other sites More sharing options...
Jessica Posted April 10, 2013 Share Posted April 10, 2013 Did you bother searching google? I found an answer in less than 1 minute. Quote Link to comment Share on other sites More sharing options...
liveproject101 Posted April 11, 2013 Share Posted April 11, 2013 You may use following code to insert image in Excel with the help of Php: $fileType = 'Excel2007'; $fileName = 'test.xlsx'; // Load the workbook $objPHPExcelReader = PHPExcel_IOFactory::createReader($fileType); $objPHPExcel = $objPHPExcelReader->load($fileName); // Add an image to the worksheet $objDrawing = new PHPExcel_Worksheet_Drawing(); $objDrawing->setName('My Image'); $objDrawing->setDescription('The Image that I am inserting'); $objDrawing->setPath('./images/myImage.png'); $objDrawing->setCoordinates('B2'); $objDrawing->setWorksheet($objPHPExcel->getActiveSheet()); // Save the workbook $objPHPExcelWriter = PHPExcel_IOFactory::createWriter($objPHPExcel,$fileType); $objPHPExcelWriter->save($fileName); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.