セクションのイベント発生順は、セクションのプロパティ設定によって大きく変化します。なかでもNewPage、KeepTogether、GroupKeepTogether、NewColumnプロパティなど、改ページ処理に関連するものは非常に大きな影響を与えます。このトピックでは、改ページ処理によるイベント発生順の変化を解説します。
観測に用いたレポートは以下の3つです。
セクション(グループヘッダ、詳細、グループフッタ)、レコード数:6(3レコード/ページ)、グループ数:2、総ページ数:2
レポート1のグループヘッダのNewPageプロパティを「Before」に設定しグループ毎に改ページさせたレポート。
レポート1のグループフッタのNewPageプロパティを「After」に設定しグループ毎に改ページさせたレポート。
※出力結果はレポート2と同じです。
レポート1のグループヘッダのGroupKeepTogetherプロパティを「All」に設定し、改ページされたレポート。
※出力結果はレポート2と同じです。
それぞれのレポートを実行し、セクションイベントの発生順を観測すると、以下のような結果となります。
| レポート1 | レポート2 | レポート3 | レポート4 | |
|---|---|---|---|---|
| 1 | ReportStart | ReportStart | ReportStart | ReportStart |
| 2 | PageStart | PageStart | PageStart | PageStart |
| 3 | GroupHeader1_Format | GroupHeader1_Format | GroupHeader1_Format | GroupHeader1_Format |
| 4 | GroupHeader1_BeforePrint | GroupHeader1_BeforePrint | GroupHeader1_BeforePrint | GroupHeader1_BeforePrint |
| 5 | GroupHeader1_AfterPrint | GroupHeader1_AfterPrint | GroupHeader1_AfterPrint | GroupHeader1_AfterPrint |
| 6 | Detail_Format:1 | Detail_Format:1 | Detail_Format:1 | Detail_Format:1 |
| 7 | Detail_BeforePrint:1 | Detail_BeforePrint:1 | Detail_BeforePrint:1 | Detail_BeforePrint:1 |
| 8 | Detail_AfterPrint:1 | Detail_AfterPrint:1 | Detail_AfterPrint:1 | Detail_AfterPrint:1 |
| 9 | Detail_Format:2 | Detail_Format:2 | Detail_Format:2 | Detail_Format:2 |
| 10 | Detail_BeforePrint:2 | Detail_BeforePrint:2 | Detail_BeforePrint:2 | Detail_BeforePrint:2 |
| 11 | Detail_AfterPrint:2 | Detail_AfterPrint:2 | Detail_AfterPrint:2 | Detail_AfterPrint:2 |
| 12 | Detail_Format:3 | Detail_Format:3 | Detail_Format:3 | Detail_Format:3 |
| 13 | Detail_BeforePrint:3 | Detail_BeforePrint:3 | Detail_BeforePrint:3 | Detail_BeforePrint:3 |
| 14 | Detail_AfterPrint:3 | Detail_AfterPrint:3 | Detail_AfterPrint:3 | Detail_AfterPrint:3 |
| 15 | ||||
| 16 | ||||
| 17 | ||||
| 18 | GroupHeader1_Format | GroupHeader1_Format | PageEnd | GroupHeader1_Format |
| 19 | GroupHeader1_BeforePrint | PageEnd | PageStart | Detail_Format:4 |
| 20 | GroupHeader1_AfterPrint | PageStart | GroupHeader1_Format | PageEnd |
| 21 | Detail_Format:4 | Detail_Format:4 | GroupHeader1_BeforePrint | PageStart |
| 22 | PageEnd | GroupHeader1_BeforePrint | GroupHeader1_AfterPrint | Detail_Format:5 |
| 23 | PageStart | GroupHeader1_AfterPrint | Detail_Format:4 | GroupHeader1_BeforePrint |
| 24 | Detail_Format:5 | Detail_BeforePrint:4 | Detail_BeforePrint:4 | GroupHeader1_AfterPrint |
| 25 | Detail_BeforePrint:4 | Detail_AfterPrint:4 | Detail_AfterPrint:4 | Detail_BeforePrint:4 |
| 26 | Detail_AfterPrint:4 | Detail_Format:5 | Detail_Format:5 | Detail_AfterPrint:4 |
| 27 | Detail_BeforePrint:5 | Detail_BeforePrint:5 | Detail_BeforePrint:5 | Detail_BeforePrint:5 |
| 28 | Detail_AfterPrint:5 | Detail_AfterPrint:5 | Detail_AfterPrint:5 | Detail_AfterPrint:5 |
| 29 | Detail_Format:6 | Detail_Format:6 | Detail_Format:6 | Detail_Format:6 |
| 30 | Detail_BeforePrint:6 | Detail_BeforePrint:6 | Detail_BeforePrint:6 | Detail_BeforePrint:6 |
| 31 | Detail_AfterPrint:6 | Detail_AfterPrint:6 | Detail_AfterPrint:6 | Detail_AfterPrint:6 |
| 32 | ||||
| 33 | ||||
| 34 | ||||
| 35 | PageEnd | PageEnd | PageEnd | PageEnd |
| 36 | ReportEnd | ReportEnd | PageStart | ReportEnd |
| 37 | PageEnd | |||
| 38 | ReportEnd |