2015-10-06 58 views
0
<cfif currentrow mod #Arguments.numbersDown# is 0> 
<cfdocumentitem type="pagebreak"/> 
</cfif> 

我打算在記錄號達到指定的數字(numbersDown)後使用分頁符。但是,上面的代碼將打印多個頁面,然後在最後一頁上打印記錄。 無論如何解決這個問題或其他方式來強制分頁?Coldfusion cfdocument pagebreak issue

注意:上面的代碼在一個表內。

+2

請[更新問題](http://stackoverflow.com/posts/32971868/edit)帶*小*,自包含的示例,演示:然而相似可以與「標題」來實現你描述的問題。 – Leigh

+0

有了這麼少的信息: – shemy

回答

0

我相信這應該工作。也不適合我。

<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>