views:

264

answers:

3

Is there a way to generate Excel spreadsheets with Perl on Linux so that I can open the spreadsheet on Windows and it creates native Excel graphics? I know that there are libs to draw graphics but all libs I know simply insert a picture to the Excel which looks weird when I open the spreadsheet on Windows. So I wondering is there a way to do it better? Possibly I could embed a VB script or something so that it creates a graphics automatically when I open the spreadsheet on Windows? The original spreadsheet must be generated on Linux so there are no ways to use OLE or some other Windows-only technology.


Thanks guys! Spreadsheet::WriteExcel seems to be a good solution. Did not understand at the first glance if it allows to change dimensions of data or it is hardcoded in a template file (10 points for example, no more, no less). Does anyone know?

If anyone knows another way of doing my task, please post it here. I'm interested in comparing of different solutions and select the best.

+5  A: 

Try Spreadsheet::WriteExcel.

heferav
+10  A: 

Yes, Spreadsheet::WriteExcel has a embed_chart($row, $col, $filename, $x, $y, $scale_x, $scale_y) function which lets you do this.

Benj
+8  A: 

Spreadsheet::WriteExcel allows you to insert charts from existing files (with some caveats).

See, the following sub-document on Spreadsheet::WriteExcel Charts and the examples files in the distro, such as this one.

P.S. I am the author of that module.

jmcnamara
Hey, thank you then. I used that module in my former job and it worked flawlessly.
Leonardo Herrera
Yes, cheers, what a great module :-)
Benj