Spreadsheet::WriteExcel actually expects a filename to be passed to ->insert_image(), not raw image data. The following, fairly minimal example works for me:
#!/usr/bin/perl use strict; use warnings; use Spreadsheet::WriteExcel; my $workbook = Spreadsheet::WriteExcel->new("Employees.xls"); my $worksheet = $workbook->add_worksheet("Summary"); $worksheet->insert_image('A1', 'Lenna.png'); $workbook->close();
Since you're pulling the image from a database, you may have to write it to a temporary file. That, or bug the module's author to add a function that takes image data and inserts it directly into the spreadsheet.
In reply to Re: Need help with inserting images to excel from db
by AppleFritter
in thread Need help with inserting images to excel from db
by terrykhatri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |