Basic formulas with the query2xls component

I've added some formula handling to the query2xls component.

Basically, you create an empty query column, and then pass in a formula
for evaluation along with that empty column name.

Something like this:

<cfobject name="query2xls" component="query2xls" />
        <cfset queries = structNew() />
        <cfset formulas = structNew() />
        <cfset queries[1]["sheet1qry"] = data />
        <cfset formulas[1]["formulas"] = formula />
        <cfset daXls = query2xls.queriesToXLS(queries,formulas) />
        <cfset cvalue = 'attachment;' />
        <cfset cvalue = cvalue & "filename=test.xls" />
        <cfheader name="Content-Disposition" value="#cvalue#" />
        <cfcontent type="application/msexcel" variable="#daXls#" reset="true" />
        <cfabort />

Where data is a query, and formula is a string like this: formulacolumn = SUM(discount + amount)

formulacolumn being an empty query field, and discount and amount being numeric query columns.

Source is here:

Zip of the source:

cfjexcel begins (again?)

I've put the really rough draft of cfjexcel up... it's a couple of cfc's that are working locally but not here, so I'll have to wank with them some more, but what the hell, if you're curious, here's the test URL: cfjexcel/test.cfm

The code is available over at google code:

BlogCFC was created by Raymond Camden. This blog is running version Contact Blog Owner