2011/06/01

ページ合計 (Page total)

ページ合計の表示にはadd-page-totalを使用します。使用方法はOTNでもたびたび紹介されている他、以下のURLでもサンプルを見ることができます。
http://winrichman.blogspot.com/2010/01/page-total.html


基本的な使用例は以下の通りです。以下の例では、SAL列のページ合計をvTotalにて集計します。
<?add-page-total:vTotal;'SAL'?>

add-page-totalはページ単位の合計を集計・出力する他、以下の様に集計対象に定数を指定することでカウントを行うこともできます。
<?add-page-total:vCount;1?>

また、ifと組み合わせることで、条件に該当するレコード件数を出力することもできます。以下の例では、SALが2000より大きいレコードをページ単位でカウントします。
<?if:SAL>2000?>
  <?add-page-total:vCondCount;1?>
<?end if?>

ページ合計の出力はヘッダまたはフッタにshow-page-totalを記述します。なお、最後の引数は書式をあらわします。書式はオラクル書式です。
<?show-page-total:vTotal;'99G999G999D00'?>



[Summary]
The following URL explains the basic usage of add-page-total and show-page-total.

http://winrichman.blogspot.com/2010/01/page-total.html


By setting the static number '1', instead of column name, you can get the count of the record in each page.
<?add-page-total:vCount;1?>


You can use if clause with add-page-total. The following example counts the record with SAL higher than 2000.
<?if:SAL>2000?>
  <?add-page-total:vCondCount;1?>
<?end if?>


0 件のコメント:

コメントを投稿