ColdFusion Query Output to CSV File

ColdFusion to CSV made easy!

An application by Matthew J. Drollinger

ColdFusion database to Excel output

Create a csv (comma-separated value) file on the fly using data gathered from a query in ColdFusion.

This custom ColdFusion tag and documentation will save you time in finding a way to generate csv formatted reports of database data (or data extracted from another type of recordset) through ColdFusion MX. This will allow you to easily produce csv output from a database (or other types of record set objects) in minutes.

ColdFusion MX csv generation

It's as simple as:

  1. Place the custom tag file in your web site's working directory
  2. Create a query recordset in ColdFusion...
    <CFQUERY NAME="getProducts" DATASOURCE="store-database">
         SELECT
    *
         FROM
    Products
         
    ... other optional SQL
    </CFQUERY>
  3. Insert a few lines of code...
    <CF_QRY2CSV
         FILENAME="
    products.csv"
         QUERY="#
    getProducts#"
         
    ... other optional parameters
    >

Data gathered into a recordset from ColdFusion can be output to a csv file.

CSV from ColdFusion MX

ColdFusion to csv format can be quickly and easily implemented using the cf documentation that is available here. This is similar to creating an Excel file from a Cold Fusion database query.

Output Access database to CSV file with ColdFusion (CF)

Records gathered from a query are transformed into a csv-safe (Microsoft Excel-readable) format. This latest version has a great set of new and improved features.

ColdFusion Query to CSV Features:

* New in latest version

Export data to CSV file with ColdFusion

This custom ColdFusion tag and documentation will help you create a ColdFusion export to csv format application that can be used over and over. This tutorial will show you how to implement a database export to csv file format using cold fusion (cf).

This tag comes is useful when exporting data from your ColdFusion application to another system. Why CSV? CSV is one of the most widely used file format for interchanging data. Several popular applications, such as Microsoft Excel, Microsoft Outlook, Quickbooks, Yahoo Email, etc. are capable of reading and storing their data in the CSV format.

This tag can be used in a CF website that needs to export its data to Excel, Outlook, Quickbooks, and other applications capable of reading or importing CSV data.

It can also be used in a CF website that needs to export data to other data sources. Some of the most popular databases, such as Microsoft Access, SQL Server, Oracle, and mySQL have a tool to read CSV files and retrieve data from them. Once the data has been exported to CSV, it can then be imported to your other datasource.


Example:

Data Table

ID FIRST NAME LAST NAME POSITION HIRE DATE
1 John Smith President 1/15/2006
2 Jane Doe Manager 1/24/2006
3 Fred Johnson Clerk 1/18/2006

CSV File Output

Download this data in CSV format


User-Defined Example:



Custom Tag and Documentation - Single Server License for Windows servers:
Now only $29.99

Custom Tag and Documentation - Single Server License for Linux servers:
Currently Unavailable

Purchase includes the custom tag (.cfm), downloadable documentation (.pdf), example file (.cfm), and license agreement (.txt), all within a zipped folder (.zip).

After purchase through PayPal (MasterCard, Visa, American Express, Discover), you will be emailed a download link.

View the license before purchasing

Export ColdFusion data into a CSV file.

Turn a CF query into a CSV file.