1

I have to add a image to the spreadsheet using PEARL Spreadsheet_Excel_Writer library and I have used insertBitmap() method for that, but after the execution of the code, the file is created and when going to open the file it will gives me below error:

Excel found unreadable content in 'testXls.xls'. Do you want to recover the content of workbook? ......

This is how I'm adding the image in the code,

$excel = new Spreadsheet_Excel_Writer($saveDirectory);
$sheet =& $excel->addWorksheet('Class I');
$sheet->insertBitmap( 2 , 2 , 'upload_files/1.bmp' , 1 , 1 , 2 , 2 );

Without insertBitmap() method file is perfectly save and open.

Anyone has any ideas why this error arise?

j0k
  • 22,600
  • 28
  • 79
  • 90
user1890970
  • 83
  • 1
  • 8
  • Watch out, if you aren't getting a Notice from the `addWorksheet` line, you may have your `error_reporting` set too low. This may be hiding other unrelated errors. – Charles Dec 10 '12 at 08:10
  • @Charles I have added "if(PEAR::isError($excel)) { die($excel->getMessage()); }" this code line to check whether there are any hidden errors, but no error appears, but issue still remains – user1890970 Dec 10 '12 at 08:32
  • That'll cover fatals, but I'm not talking about fatals. I'm talking about warnings, notices and such. Those matter. The little things add up. You may well be killing yourself with papercuts here, so to speak. – Charles Dec 10 '12 at 08:38
  • @Charles yeah, you are right, but I couldn't find any related warning or notices in eclipse editor, and I'm using Zend framework as my php framework, there I have already enabled to show Waring and errors, but nothing comes out, may be something wrong with the image file, but the image is 24 bit bitmap as it requires. – user1890970 Dec 10 '12 at 09:32
  • @user1890970 : were u able to resolve this issue...if yes then please help me....i am also stuck into this same situation... – tanrich Jun 10 '14 at 06:37

0 Answers0