如何将 Coldfusion10 查询的结果导出为 html? 用户当前正在上传包含狗的 Excel 工作表,我需要将pitBullcheck 查询的结果输出到 html 表以显示其中包含有pitbulls 的行。品种是 Excel 工作表中的一列。
<cffunction name="validateExcelSheet" access="public" output="yes" returnType="void"
hint="check dogs">
<cfspreadsheet
action="read"
src="#SESSION.theFile#"
headerrow= "1"
excludeHeaderRow = "true"
query = "allData"
rows = "1-#lastRow#" />
<cfscript>
pitBullcheck = new Query(
sql ="SELECT * FROM allData where breed like 'Pit' ",
dbtype = "query",
allData = allData);
pitBullresult = pitBullcheck.execute().getResult();
</cfscript>
</cffunction>
最佳答案
<table>
<tr>
<td>breed</td>
</tr>
<cfoutput query="pitBullresult">
<tr>
<td>#pitBullresult.breed#</td>
</tr>
</cfoutput>
</table>
然后只需添加额外的 <td>
对于查询中的每一列。
关于coldfusion - 如何将 Coldfusion10 查询的结果导出为 html?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21819487/