Jump to content

Recommended Posts

Posted

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.

Posted

Welcome, omegafi. Hopefully someone will come along soon with information on this subject.

Posted

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();

?>

Posted

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.

Posted

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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...