Coldfusion cfdocument发行-cfdocument没有正文
我正在使用Coldfusion10,并且面临以下错误:Coldfusion cfdocument发行-cfdocument没有正文,coldfusion,cfml,Coldfusion,Cfml,我正在使用Coldfusion10,并且面临以下错误: The following information is meant for the website developer for debugging purposes. Error Occurred While Processing Request cfdocument tag has no body. It must have a body or a source file or URL. 我检查了网站,发现顶部或任何可能导致此问题的地
The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request
cfdocument tag has no body.
It must have a body or a source file or URL.
我检查了网站,发现顶部或任何可能导致此问题的地方未定义cfsettings
,我将其用作
<cfdocument format="pdf">
<cfdocumentsection>
<cfdocumentitem type="header"></cfdocumentitem> - Footer is used too
</cfdocumentsection>
-也使用页脚
我尝试使用
evalAtPrint=true
,但仍然没有成功。我在这里遗漏了什么吗?请确保你在最后确实投入了。我猜你错过了这个
否则,一切似乎都与现实相符
我建议两件事
问题中包含的错误消息表明
标记之间没有内容。你包含的代码证实了这一点。如果这不是您的实际代码,那么我们将无法提供太多帮助
您需要在
标记之间包含要转换为PDF格式的内容。你需要这样的东西:
<cfquery datasource="cfdocexamples" name="empSalary">
SELECT Emp_ID, firstname, lastname, e.dept_id, salary, d.dept_name
FROM employee e, departmt d
WHERE e.dept_id = d.dept_id
ORDER BY d.dept_name
</cfquery>
<cfdocument format="PDF">
<cfoutput query="empSalary" group="dept_id">
<cfdocumentsection>
<cfdocumentitem type="header">
<font size="-3"><i>Salary Report</i></font>
</cfdocumentitem>
<cfdocumentitem type="footer">
<font size="-3">Page #cfdocument.currentpagenumber#</font>
</cfdocumentitem>
<h2>#dept_name#</h2>
<table width="95%" border="2" cellspacing="2" cellpadding="2" >
<tr>
<th>Employee</th>
<th>Salary</th>
</tr>
<cfset deptTotal = 0 >
<!--- inner cfoutput --->
<cfoutput>
<tr>
<td>
<font size="-1">#empSalary.lastname#, #empSalary.firstname#</font>
</td>
<td align="right">
<font size="-1">#DollarFormat(empSalary.salary)#</font>
</td>
</tr>
<cfset deptTotal = deptTotal + empSalary.salary>
</cfoutput>
<tr>
<td align="right"><font size="-1">Total</font></td>
<td align="right"><font size="-1">#DollarFormat(deptTotal)#</font></td>
</tr>
<cfset deptTotal = 0>
</table>
</cfdocumentsection>
</cfoutput>
</cfdocument>
选择Emp\u ID、firstname、lastname、e.dept\u ID、salary、d.dept\u name
从员工e处,离开MT d
其中e.dept\u id=d.dept\u id
按部门名称订购
工资报告
第#页cfdocument.currentpagenumber#
#部门名称
雇员
薪水
#empSalary.lastname#,#empSalary.firstname#
#美元格式(empalary.salary)#
全部的
#DollarFormat(deptottal)#