首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Coldfusion cfdocument分页问题

Coldfusion cfdocument分页问题
EN

Stack Overflow用户
提问于 2015-10-06 21:55:43
回答 1查看 140关注 0票数 0
代码语言:javascript
复制
<cfif currentrow mod #Arguments.numbersDown# is 0>
 <cfdocumentitem type="pagebreak"/>
</cfif>

我计划在记录数达到指定数量(numbersDown)后使用分页符。但是,上面的代码将打印几页,然后在最后一页打印记录。有没有办法解决这个问题,或者有其他强制分页符的方法?

注意:上面的代码在一个表中。

EN

回答 1

Stack Overflow用户

发布于 2015-10-09 19:36:22

我相信这应该行得通。对我来说也不起作用。然而,‘header’也可以达到类似的效果:

代码语言:javascript
复制
 <cfdocument format="PDF" filename="#local.sTargetPDFName#" overwrite="yes" orientation="portrait"  marginright=".2" marginleft=".2" marginbottom=".2" margintop=".2" localURL='Yes'>
        <table cellspacing="0" cellpadding="0" border="0" width="100%">
            <cfset   dPerPage=local.qPHForm10A.recordCount/2 />
            <cfset sRow=1 />    
            <cfloop index="local.nowIndx" from="1" to="#dPerPage#">
                <cfset eRow=sRow +2 />
                   <tr>
                     <th align="center" bgcolor="##efefef" class="noBorder">Account</th>
                     <th align="center" bgcolor="##efefef" class="noBorder">Funds</th>
                     <th align="center" bgcolor="##efefef" class="noBorder">Balance</th>
                   </tr>
                   <cfloop query="local.qPHForm10A" startrow="#sRow#" endrow="#eRow#">

                   <tr>
                     <td class="noBorder noPadding">
                        <table cellpadding="0" cellspacing="0" border="0" class="borderList" width="100%">
                          <tr>
                            <td class="noleftBorder">#DateFormat(rc.qPayementHistoryForm10A.PAYMENT_DATE,"mm/dd/yyyy")#</td>
                            <td>#local.qPHForm10A.VAL1#</td>
                            <td>#local.qPHForm10A.VAL2#</td>
                            <td>#local.qPHForm10A.VAL3#</td>
                          </tr>
                       </table>
                     </td>
                    </tr>
                 </cfloop>
                 <cfset sRow=sRow+2 />
                 <cfdocumentitem type="header"></cfdocumentitem>
                </cfloop>
            </table>
        </td>
    </tr>

</table>
</cfdocument>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32971868

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档