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:
- Place the custom tag file in your web site's working directory
- Create a query recordset in ColdFusion...
<CFQUERY NAME="getProducts" DATASOURCE="store-database">
SELECT *
FROM Products
... other optional SQL
</CFQUERY>
- 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:
- CSV string data created on the fly
- Allows the creation of custom field headers
- Includes concise, easy-to-follow documentation to start creating csv files from record sets in just minutes
- Handles multiple data types (strings, numbers, dates, boolean data, etc.)
- Extremely fast deployment. No third party application or CFX tags to install.
- May be used any number of times on a single server.
- * Now in an easy-to-use ColdFusion tag syntax
- * Handles more difficult data (commas, quotation marks, line breaks, etc.)
- * Allows the choice of data fields to display and the ability to specify their order!
* 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:
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.
ColdFusion Query Output to CSV Format
Application Code: CF-Q2CSVR2
Language: ColdFusion
Developer: Matthew J. Drollinger – midimatt@hotmail.com
Web Site: http://www.mattdrollinger.com/coldfusion-query-to-csv.cfm
Release Date: September 10, 2007
Copyright: ©2007 Matthew J. Drollinger
Application Description:
This custom ColdFusion application and associated tag may be used to create ColdFusion applications that will generate a comma-separated value (.csv) file using data gathered in a ColdFusion Query recordset. The script found in this tag will properly format values that are to be stored in the .csv file, including values containing quotation marks, commas, and line breaks.
License:
This script may not be sold, distributed, or communicated, in part or in full, to any person or organization other than those who have purchased usage rights to the script directly from Matthew Drollinger or a service selling this script on behalf of Matthew Drollinger. Any encrypted ColdFusion application code included in this release may not be decrypted. It is understood that what appears in the documentation provided upon purchase is the only documentation and support that will be provided with this script. The person or organization licensing this script may use it any number of times on a single server. Installation on additional servers require additional licenses. It is understood that legal hearings brought about by the distribution or use of this script will be held in the state of Wisconsin at an institution chosen by Matthew Drollinger. Infringements of this license are subject to fines and prosecution to the maximum extent allowed by law.
View the license before purchasing
Export ColdFusion data into a CSV file.
Turn a CF query into a CSV file.