http://qs321.pair.com?node_id=333258


in reply to Re: Generating an Excel Report
in thread Generating an Excel Report

The naming a file .xls trick has more uses, too.

You can mark up an HTML table and apply font and centering options, and also formulas, then save it as .xls, and Excel won't complain. See this snippet for a simple example.

Formulas look like this:

<td x:num x:fmla="=B2+1"></td>

Replies are listed 'Best First'.
Re: Re: Re: Generating an Excel Report
by Grygonos (Chaplain) on Mar 02, 2004 at 15:49 UTC

    If you're on a Win32 platform you can also use Win32::OLE I don't know if it is bulkier or less efficient than Spreadsheet::WriteExcel, but it's what I have used, in the past (well yesterday really).

    This script runs some queries against a SQL Server Database to create the report that is then created and formatted via Win32::OLE. This is really more than you need, but its an example of a report that uses a decent amount of features and gives you an idea of what kind of code is needed to properly format something. Writing your own is more rewarding than gutting this one and making it fit your needs, so please do so if you find this one useful.

    Grygonos