<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Sample 9</title>
</head>

<body>

<!-- An example showing how to read in an excel file with 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.
			HeaderRow= Yes or No (if yes, the first row of the Excel sheet will become the query column names.
								 if they contains spaces or characters not allowed to be ColdFusion query column names they are
								 substituted or removed.)
			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())#\read2.xls" NAME="myExcel" SHEETBYINDEX="1" HEADERROW="yes" COLUMNS="excelColumns">

<table>
	<tr>
		<cfoutput>
		<cfloop index="theColumn" list="#excelColumns#" delimiters=",">
		<th>#theColumn#</th>
		</cfloop>
		</cfoutput>
	</tr>
	<cfoutput query="myExcel">
	<tr>
		<cfloop index="theColumn" list="#excelColumns#" delimiters=",">
		<td>#Evaluate("#theColumn#")#</td>
		</cfloop>
	</tr>
	</cfoutput>
</table>


</body>
</html>