Thursday, April 29, 2010

Tool for uploading Excel file in Coldfusion

This tool needs to be purchased before using it but this is really cool. For all CF enthusiasts who needs to upload from excel files, check this out.

What Is CFX_Excel2Query?

Transform a Microsoft Excel file into a ColdFusion query without installing Excel on your server! This tag is written in 100% java, so there is no need for the dreaded COM. This tag works best with simple Excel files, but many have had luck with extremely complex files.

Usage

<cfx_excel2query
file=
"[path_to_xls_file]"
firstRowIsHeader=
"[true|false]"
sheet_name=
"[worksheet_name]"
sheet_num=
"[worksheet_number]"
startRow=
"[starting_row]"
maxRows=
"[max_rows]"
longNames=
"[true|false]"
r_qResults=
"[query_variable_name]">


Attribute

Req'd

Description

file

Yes

full path the Microsoft Excel file

r_qResults

Yes

the variable in which to store the resulting query

firstRowIsHeader

No

specifies whether or not the first row of the Microsoft Excel file should be used for the column names in the query

sheet_name

No

specifies a specific worksheet name (case sensitive) to use from the Microsoft Excel file

sheet_num

No

specifies a worksheet by a number (zero-based; first sheet is zero, second sheet is 1, etc) - If sheet_num and sheet_name are both specified, sheet_num is used.

columnlist

No

the list of column names in their original order is returned to the variable you choose here (especially useful when firstRowIsHeader)

startRow

No

The row number, starting at 1, you would like to start from

maxRows

No

The total number of rows from startRow that you want to return

longNames

No

Use zero padding on column names (i.e. column001,column002,..,columnN)

No comments: