2011-02-23
任意の場所で改ページ
好きなところで改ページするには、対象のエレメントの、対象の
イベント(On〜)で以下のように記述。
this.getStyle().pageBreakAfter = "Always";
pageBreakBeforeプロパティは前で、
pageBreakAfter プロパティは後で。
グルーバルパラメータに毎回ブレークしたいデータを渡して、
前の値と変わったら、ブレークさせるなど。
「グローバル変数作成」
reportContext.setGlobalVariable("currheight", new Float(curh));
「判定。条件に合致したとこで改ページ」
importPackage(Packages.java.lang);
var curh = parseFloat(reportContext.getGlobalVariable("currheight"));
var numofrowsingroup = this.getRowData().getColumnValue("Aggregation");
if( *1 > 6.0 ){
this.getStyle().pageBreakBefore = "Always";
}
種類は、
「Always 」
Always insert a page break before or after the
selected element.
「Auto 」Insert a page break before or after the element
as necessary. Auto is the default value.
「Avoid」 Avoid inserting a page break before or after the
selected element.
「Always Excluding First」 Applies only to groups and Page Break Before.
Always insert a page break before each
instance of the selected group, but not before
the first instance.
「Always Excluding Last」 Applies only to groups and Page Break After.
Always insert a page break after each instance
of the selected group, but not after the last
instance.
*1:curh)+(numofrowsingroup*.2
- 1 http://k.hatena.ne.jp/keywordblog/Java?next=3679659934867596495
- 1 http://search.minakoe.jp/rsss/rsss.asp?pgsz=100&qry=java¬wit=1&twit=0&debug=1&multi=1
- 1 http://tsmailserv.mhts.jp/mail/D404102.nsf/iNotes/Mail/?OpenDocument&ui=dwa_frame&l=ja&gz&CR&MX&TS=20110221T181355,10Z&charset=UTF-8&charset=UTF-8&ua=ie

