CFDOCUMENTITEM  
説明

cfdocument タグによって作成された PDF または FlashPaper ドキュメントに対するアクション項目を指定します。次のアクションがあります。

  • page break (改ページ)
  • header (ヘッダ)
  • footer (フッタ)
 
カテゴリ

データ出力タグ

 
シンタックス
<cfdocument ...>
シンタックス 1
<cfdocumentitem type = "pagebreak"/>

シンタックス 2
   <cfdocumentitem
      type = "header"、"footer">
header/footer text
</cfdocumentitem>

</cfdocument>
 
関連項目

cfreport、cfdocument、cfdocumentsection

 
ヒストリ

ColdFusion MX 7: このタグが追加されました。

 
使用方法

cfdocumentitem タグを使用して、PDF または FlashPaper レポートの形式設定を制御します。このタグは、<cfdocument> </cfdocument> ペアで囲む必要があります。

改ページ、ランニングヘッダ、またはランニングフッタごとに 1 つの cfdocumentitem タグをコーディングします。

cfdocument スコープ変数、cfdocument.currentpagenumber を使用して、現在のページ番号をヘッダまたはフッタに表示することができます。cfdocument.totalpagecount を使用して、ページの総数を表示することもできます。例 :

...
<cfdocumentItem type= "footer>
   #cfdocument.currentpagenumber# of #cfdocument.totalpagecount#
</cfdocumentitem>

次に示すように、cfdocumentsection タグの有無にかかわらず、cfdocumentitem タグを使用することができます。

cfdocumentsection が設定されていない場合 : cfdocumentitem 属性は、次に示すようにドキュメント全体に適用されます。

  • このタグがキュメントの先頭にある場合、タグはドキュメント全体に適用されます。
  • このタグがドキュメントの途中にある場合、タグはドキュメントの残りの部分に適用されます。
  • このタグがドキュメントの末尾にある場合、タグの効果はありません。

cfdocumentsection タグが設定されている場合 : cfdocumentitem 属性はそのセクションのみに適用され、以前に指定したヘッダおよびフッタは無効になります。

 
<cfquery datasource="cfdocexamples" name="parksQuery">
SELECT parkname, suptmgr from parks
</cfquery>

<cfdocument format="PDF">
  <cfdocumentitem type="header">National Parks Report</cfdocumentitem>
  <!--- 総ページ中の現在のページを示すフッタを使用 --->
  <cfdocumentitem type="footer">
    <cfoutput>Page #cfdocument.currentpagenumber# of #cfdocument.totalpagecount#</
cfoutput>
 </cfdocumentitem>

<h1>公園リスト</h1>
<table width="95%" border="2" cellspacing="2" cellpadding="2" >
  <tr >
    <th>公園</th>
    <th>Manager</th>
  </tr>
 <cfoutput query="parksQuery">
   <tr>
    <td><font size="-1">#parkname#</font></td>
    <td><font size="-1">#suptmgr#</font></td>
   </tr>
 </cfoutput>
</table>
</cfdocument> 
TYPE  
  必須
 

アクションを指定します。

  • pagebreak: タグの位置で新規ページを開始します。
  • header: <cfdocumentitem> タグと </cfdocumentitem> タグの間のテキストをランニングヘッダとして使用します。
  • footer: <cfdocumentitem> タグと </cfdocumentitem> タグの間のテキストをランニングフッタとして使用します。