したがって、cfspreadsheet で列名を設定するためにドットで省略しても、特殊文字を使用できないようです。これを回避する方法はありますか?私は基本的に、クエリ結果を cfspreadsheet を使用して Excel ファイルにダンプしており、特定の用語を短縮するためにドット記号などの特定の文字を保持する必要があります。実際に次のレベルに引き上げて、これらの列名にも特殊文字を使用するとよいでしょう。これに対する回避策はありますか?
コードサンプル。
<cfset qryColumnList = "CaseNo,Model,Name" />
<cfset qryResultSet = QueryNew(qryColumnList) />
<cfoutput query="getUsedCars">
<cfset QueryAddRow(qryResultSet, 1) />
<cfset querySetCell(qryResultSet, "CaseNo", caseno EQ " " ? "" : caseno) />
<cfset querySetCell(qryResultSet, "Model", model EQ " " ? "" : model) />
<cfset querySetCell(qryResultSet, "Name", name EQ " " ? "" : name) />
</cfoutput>
<cfscript>
xlsxopencases = SpreadsheetNew("opencases",true);
SpreadsheetAddRow(xlsxopencases,qryColumnList);
SpreadsheetAddRows(xlsxopencases,qryResultSet);
strFileName=GetDirectoryFromPath(GetCurrentTemplatePath()) & "OpenCasesReport.xlsx";
SpreadsheetFormatRow(xlsxopencases, {bold="true"}, 1);
SpreadsheetFormatRows(xlsxopencases, {dataformat="text"}, "1-#qryResultSet.recordcount + 1#");
SpreadsheetFormatColumn(xlsxopencases, {dataformat="dd/MM/yy HH:mm:SS"},18);
</cfscript>
<cfspreadsheet action="write"
filename="#strFileName#"
name="xlsxopencases"
sheet="1"
sheetname="OpenCasesReport"
overwrite="true" />
<cfheader name="Content-Disposition" value="attachment; filename=OpenCasesReport.xlsx">
<cfcontent file="#strFileName#" type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
<cffile action="delete" file="#strFileName#" />
</cfif>