omegafi Posted May 14, 2008 Posted May 14, 2008 Hi, having issues with insertBitmap(). Do you have any examples or suggestions on how to get a image through excelwriter to the page? cshaw@omegafi.com Thanks. Quote
TCH-Bruce Posted May 14, 2008 Posted May 14, 2008 Welcome to the forums omegafi. Sorry, I don't have a clue but maybe one of our members will have a suggestion. Quote
Bunni Posted May 15, 2008 Posted May 15, 2008 Welcome, omegafi. Hopefully someone will come along soon with information on this subject. Quote
MikeJ Posted May 15, 2008 Posted May 15, 2008 What kind of problem are you having with insertBitmap()? Here's a very basic example of inserting a Bitmap into a spreadsheet and sending it to the browser that works in TCH's environment. Your environment may differ: ><?php ini_set("include_path", get_include_path().":/home/myaccount/php"); ini_set("max_execution_time","30"); // not required unless you are hitting a limit ini_set("memory_limit","32M"); // not required unless you are hitting a limit require_once 'Spreadsheet/Excel/Writer.php'; $workbook = new Spreadsheet_Excel_Writer(); $workbook->setTempDir('/home/myaccount/tmp'); // Creating a worksheet $worksheet =& $workbook->addWorksheet('Test for Bitmap'); $worksheet->insertBitmap(0,0,'image.bmp'); //send the file $workbook->send('test.xls'); //close the workbook $workbook->close(); ?> Quote
omegafi Posted May 15, 2008 Author Posted May 15, 2008 First off thanks for the welcome and the example. I am having issues with insertBitmap() actuall inserting. When I put that function in the code, it causes the excel worksheet to error and lose all the formatting data? Is there some unspoken file limit? My code matches ur example. My boss is all over my arse and I dont have a clue how to get the grapihc in the excel file. Is there any other ways to get graphics in? Thank, guys. Quote
MikeJ Posted May 15, 2008 Posted May 15, 2008 Unfortunately I haven't ever actually used ExcelWriter (I installed it simply to troubleshoot another person's problem), so I'm not sure how much additional help I can be. What kind of error are you getting? Are you trying to insert the bitmap into a single cell? Unfortunately the documentation for ExcelWriter is pretty sparse. Quote
omegafi Posted May 15, 2008 Author Posted May 15, 2008 I am trying to insert a bitmap in cell 0,0 of the worksheet, which is the top left hand corner. Every example( all 2 of them) on the internet are all the same, I copied it to the t and it says that it can't load with available resources. Quote
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.