in reply to How to display the Excel::Writer::XLSX chart image to the web browser with CGI?

If you are you trying to open the Excel document via a browser https://fastapi.metacpan.org/source/JMCNAMARA/Excel-Writer-XLSX-0.98/examples/cgi.pl should work, you don't say how this failed. If you mean you have a server process that runs, creates a file (including the chart), save the file and display only the chart then you need to provide more information, you don't say which OS you are running. If Windows with Excel installed you should be able to automate it via Wi32::OLE using something like Activechart.export "d:\path\goes\here\chart.png". A quick glance at the module you're using and I don't see any methods to export a chart.

Update: Seems along the lines of your last question, nothing there help you to make such graphs?

  • Comment on Re: How to display the Excel::Writer::XLSX chart image to the web browser with CGI?
  • Download Code

Replies are listed 'Best First'.
Re^2: How to display the Excel::Writer::XLSX chart image to the web browser with CGI?
by theravadamonk (Scribe) on Aug 03, 2018 at 11:49 UTC

    Thanks for your quick response.

    >>If you are you trying to open the Excel document via a browser https://fastapi.metacpan.org/source/JMCNAMARA/Excel-Writer-XLSX-0.98/examples/cgi.pl should work

    It works. It will be downloaded. I can open it.

    The code I hv given prints a NICE doughnut chart inside excel file. I ONLY need it to display via web browser. I don't need to download the whole excel file

    When I use gd:graph, it can be done with below code

    print "Content-type: image/png\n\n"; binmode STDOUT; print $myimage->png;

    How can I achieve it with Excel::Writer::XLSX ?

    >> you don't say which OS you are running.

    OS is Linux (CentOS 6.9 64 bit) without GUI. Server is Somewhere else, while I write from somewhere REMOTELY.. My Pc is Ubuntu with GUI

      "How can I achieve it with Excel::Writer::XLSX ?"

      As I said, I don't think you can do this. This module writes a file, think of it as an XML file in a zip container. It's the application that actually draws the charts. You're not using the Excel application with this module.

      Update: On Linux you should be able to open the file in OpenOffice, and extract the rendered chart, in a similar fashion to the Win32::OLE route. Take a look at OpenOffice::UNO. If you have a working solution via GD couldn't you just use that method?