Pdf CFdocumentitem分页中断不工作

Pdf CFdocumentitem分页中断不工作,pdf,coldfusion,Pdf,Coldfusion,我正在使用cfdocument将表内容保存为PDF。我使用cfoutput为查询中的每一行生成一个。每x行,我要强制分页符,插入表的标题行,并继续循环查询。实际上,在和表之间插入了几个分页符,而它完全忽略了分页符应该在哪里。标签不应该放在桌子里吗?我的代码如下: <cfdocument format="pdf" orientation="landscape"> <h1>Cumulative Daily Report</h1> <t

我正在使用cfdocument将表内容保存为PDF。我使用cfoutput为查询中的每一行生成一个。每x行,我要强制分页符,插入表的标题行,并继续循环查询。实际上,在和表之间插入了几个分页符,而它完全忽略了分页符应该在哪里。标签不应该放在桌子里吗?我的代码如下:

<cfdocument format="pdf" orientation="landscape">
    <h1>Cumulative Daily Report</h1>
        <table id="displayTable" cellspacing="0">
            <tr>
                <th>Specialist</th>
                <th>Asmnts</th>
                <th>Avg Length</th>
                <th>Day 2 Returns</th>
                <th>QPRs</th>
                <th>NCAs</th>
                <th>Asmnts</th>
                <th>Avg Length</th>
                <th>Day 2 Returns</th>
                <th>QPRs</th>
                <th>NCAs</th>
                <th># of Days</th>
                <th>AEU/th>
                <th>Asmnts</th>
                <th>QPRs</th>
                <th>NCAs</th>
                <th># of Days</th>
                <th></th>
            </tr>
            <cfoutput query="qryDisplay">
                    <cfif qryDisplay.currentRow MOD (rowsPerPage + 1) EQ 0>
                        <cfdocumentitem type="pagebreak"></cfdocumentitem>           <tr>
                            <td colspan="18">Column Header Row here</td>
                         </tr>
                    </cfif>
                <tr>
                    <td>#SpecialistName#</td>
                    <td>#numberFormat(nSixNumAssess, ",")#</td>
                    <td>#numberFormat(nSixAvgLength, ",")#</td>
                    <td>#numberFormat(nSixDay2Rets, ",")#</td>
                    <td>#numberFormat(nSixQPRs, ",")#</td>
                    <td>#numberFormat(nSixNCAs, "_._")#</td>
                    <td class="contrastBG">#numberFormat(nRtscNumAssess, ",")#</td>
                    <td class="contrastBG">#numberFormat(nRtscAvgLength, ",")#</td>
                    <td class="contrastBG">#numberFormat(nRtscDay2Rets, ",")#</td>
                    <td class="contrastBG">#numberFormat(nRtscQPRs, ",")#</td>
                    <td class="contrastBG">#numberFormat(nRtscNCAs, "_._")#</td>
                    <td>#numberFormat(nSixNumDaysWorked, ",")#</td>
                    <td class="bold">#numberFormat(nSixAEU,"_.__")#</td>
                    <td class="contrastBG">#numberFormat(nWecareNumAssess, ",")#</td>
                    <td class="contrastBG">#numberFormat(nWecareQPRs, ",")#</td>
                    <td class="contrastBG">#numberFormat(nWecareNCAs,"_._")#</td>
                    <td class="contrastBG">#numberFormat(nWecareNumDaysWorked, ",")#</td>
                    <td class="contrastBG bold rightBorder">#numberFormat(nWecareAEU,"_.__")#</td>
                </tr>
            </cfoutput>
        </table>
</cfdocument>

累积日报
专家
Asmnts
平均长度
第2天返回
QPR
NCA
Asmnts
平均长度
第2天返回
QPR
NCA
#几天
AEU/th>
Asmnts
QPR
NCA
#几天
此处为列标题行
#专业名称#
#数字格式(nsixNumasess,“,”)#
#数字格式(nSixAvgLength,“,”)#
#数字格式(nSixDay2Rets,“,”)#
#数字格式(nSixQPRs,“,”)#
#数字格式(nSixNCAs,“.”#
#数字格式(nRtscNumAssess,“,”)#
#数字格式(nRtscAvgLength,“,”)#
#数字格式(nRtscDay2Rets,“,”)#
#数字格式(nRtscQPRs,“,”)#
#数字格式(nRtscNCAs,“.”#
#数字格式(nSixNumDaysWorked,“,”)#
#数字格式(nSixAEU,“.”#
#数字格式(nWecareNumAssess,“,”)#
#数字格式(nWecareQPRs,“,”)#
#数字格式(nWecareNCAs,“\uuu.”#
#数字格式(nWecareNumDaysWorked,“,”)#
#数字格式(NWECareau,“\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu”)#

问题是您试图在一张表中打破。cfdocument的html呈现程序无法处理此问题

要解决这个问题,您必须使用TRs循环,并为创建的每个页面放置开始/结束表标记(和标题行)


请记住,在循环之前,先从开始的表标记和标题行开始,然后再关闭表。

我发现,如果分页符实际放置在td中,则分页符可以工作。因此,我最终创建了一个分页符,并在文档中每隔x行插入一个标题行,其中x是用户输入的数字,默认值为15。因此:

<cfoutput query="qryDisplay">
                <cfif qryDisplay.currentRow MOD (form.rowsPerPDFPage + 1) EQ 0>
                     <!---do a pagebreak and insert header rows. Pagebreak must be inside the td tag to work--->
                    <tr>
                        <td colspan="18" class="noBorder">
                             <cfdocumentItem type="pagebreak" />
                        </td>
                    </tr>
                    <tr>
                        <td class="bottomBorderOnly"></td>
                        <th class="topBorder leftBorder" colspan="5">Sixteenth Street</th>
                        <th class="topBorder"colspan="5">RTSC/SRT</th>
                        <th class="topBorder"colspan="2">16th/RTSC</th>
                        <th class="topBorder rightBorder" colspan="5">WeCARE</th>
                    </tr>

第十六街
RTSC/SRT
第16/RTSC
WeCARE
cfdocumentitem type=“pagebreak”在表中不起作用,因此请先关闭表,然后再放置并打开同一个表

</table>
<cfdocumentitem  type="pagebreak">
<table>


我认为这是不可能的。尝试使用第三方软件,如wkhtmltopdf。您使用的是什么版本的ColdFusion?使用CF10