<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Sample 8</title>
</head>
<body>
<!--
An example showing how to read in an excel file without header rows.
-->
<!--
CFX_XLSReader will read an Excel file and return it as a ColdFusion query.
Parameters:
Action= read or getColumnNames or getSheetNames.
XLSFile= the Excel file to read.
Name= the variable to put the returned query into.
SheetByIndex= the number/index of the sheet to read.
Columns= the variable to put the column names in. The names will be the
the same as the Excel column names. i.e. A,B,C,D,E,....,AA,AB,AC.....
-->
<CFX_XLSReader ACTION="read" XLSFILE="#GetDirectoryFromPath(GetBaseTemplatePath())#\read1.xls" NAME="myExcel" SHEETBYINDEX="1" COLUMNS="excelColumns">
<table>
<tr>
<cfoutput>
<!-- output the column names -->
<cfloop index="theColumn" list="#excelColumns#" delimiters=",">
<th>#theColumn#</th>
</cfloop>
</cfoutput>
</tr>
<cfoutput query="myExcel">
<tr>
<!-- Output the data, using evaluate since we dont know the column names. -->
<cfloop index="theColumn" list="#excelColumns#" delimiters=",">
<td>#Evaluate("#theColumn#")#</td>
</cfloop>
</tr>
</cfoutput>
</table>
</body>
</html>