Description
Current Version: 1.3 (Released 11/10/2009)

Give your customers the data they want in the #1 most commonly used data format in the world - Microsoft Excel ®. Due to the lack of native support, it has been difficult and time-consuming to offer Excel formatted files to your users from ColdFusion. Now, using the tools you have always trusted you can do just that.

With CFX_Query2Excel you can create Excel files in Microsoft Excel and populate them with data from ColdFusion queries. In this way, you don't need to bother with the construction of complex Excel formats by leveraging the power of Excel. Once your template is created, you can merge any ColdFusion query into it using CFX_Query2Excel.

Most importantly, when your ColdFusion query is merged with the Excel file, all of the existing formatting is preserved. This means that all of your colors, styles, alignment, images, charts and even formulas are preserved! What's more, CFX_Query2Excel can even create new formulas based on the pattern of formulas that exist in other rows. This means less time creating templates!



CFX_Query2Excel is written by 100% Java and leverages the powerful and trusted Jakarta POI library. This means there's no need to install Excel on your server or mess with the ugly, non-thread-safe, COM.

If you bundle CFX_Query2Excel with CFX_Excel2Query you will have a complete solution to handle all of your Excel integration needs with the flexibility of two separate tags. Imagine being able to take an unformatted data file in Excel from the user and return it fully formatted with your company's logo and tagline. The possiblities are endless.

New! Shared hosting support!
Now you can use CFX_Query2Excel in a shared hosting envirnoment without needing to register the CFX with the server! The only requirement is that your host allows you to run the createObject("java","...") function! To download the shared hosting interface, click here. Note, you will need to purchase a license below in order to use this interface.


 Purchase / Licensing
Click the "Buy Now" button below to purchase a server license for CFX_Query2Excel. If you purchase the Excel Suite you'll get both CFX_Query2Excel as well as CFX_Excel2Query and SAVE 20%!

You must purchase one license for each ColdFusion instance with which this tag will be registered. You can purchase multiple licenses by specifying the quantity during checkout.

If you purchase the Excel Suite, you must purchase one license for each ColdFusion instance with which either CFX_Excel2Query or CFX_Query2Excel will be registered. That is, a single license covers both tags on one server. If the tags are installed separate servers, a license is required for each server.


Additionally, I have had many inquires regarding the source. I have made the source available for purchase. No support will be provided.

Product Price License  
CFX_Query2Excel $29.99 Per Server Instance
Excel Suite $49.99
(SAVE 20%)
Per Server Instance
Excel Suite w/ Full Source $399.99
Per Server Instance
Sample Templates Free - Download
Shared Hosting Free - Download


 Usage
<cfx_query2excel
    query="[inputQuery]"
    templateFile="[templateXLS]"
    sheetNumber="[workbookSheet]"
    sheetName="[workbookSheet]"
    outputFile="[resultXLS]"
    startRow="[rowNumber]"
    endRow="[rowNumber]"
    maxRows="[rowNumber]"
    startColumn="[rowNumber]"
    endColumn="[rowNumber]"
    overflowAction="[append|appendStyle|ignore]"
    appendAtRow="[rowNumber]"
    appendOverwrites="[true|false]"
    incrementFormulas="[true|false]"
    createMissingCells="[true|false]"
    columnOrder="[columnList]"
    columnHeaderRow="[rowNumber]"
    columnHeadings="[listOfHeadings]"
    version="[variable]">


 Attributes
Attribute Req'd Description
query Yes The query to merge with the Excel template
templateFile Yes The full path to the Excel file you wish to use as a template. This file will only be read. The results of the merge will be written to the outputFile.
sheetNumber No The sheet number (zero-based) of the template file to which to write
sheetName No The sheet name to of the template file to which to write
outputFile Yes The full path to the Excel file to which you want the results written. This file does not need to exist. If the file already exists, it will be overwritten.
startRow No The row in the template file at which to start writing
endRow No The row in the template at which to stop writting.
maxRows No The total number of rows from the query to write to the file
startColumn No The column in the template at which to start writing
endColumn No The column in the template at which to stop writing.
overflowAction No This instructs CFX_Query2Excel as to what action it should perform if there are no more existing rows to which to write. The options are "append", "appendStyle", "ignore". Append will add new rows with no style. AppendStyle will add new rows keeping the style from the appendAtRow or the last row in the file. Ignore will ignore any overflow and stop writing to the file. (default: appendStyle)
appendAtRow No The row in the template after which additional rows will be appended.
appendOverwites No Indicates whether or not any rows after the appendAtRow will be overwritten. If "false" then any rows after the appendAtRow will be pushed down. (default: false)
incrementFormulas No Indicates whether or not CFX_Query2Excel should create new formulas based on the existing formulas when new rows are added. This allows new rows to have calculations based on the current row. (default: true)
createMissingCells No If true, CFX_Query2Excel will creating missing cells in rows to make room for the data. (default: true)
columnOrder No A list of column names in the order they should appear when merged with the template.
columnHeaderRow No The row at which the column names or columnHeadings should be written. A negative number indicates the headings should not be written. (default: -1)
columnHeadings No A comma-delimited list of heading strings that should be used in place of the column names. If this is not specified, then the column names are used.
 Installation
View the Installation Guide