Printing on odd/even pages
All report objects have the PrintOn
property. Using this property, you can print different objects on odd and even pages.
This property can be set in the "Properties" window.
This property determines on which pages the object can be printed. The property can have one of the following values or any combination of it:
- FirstPage;
- LastPage - the report must be double-pass;
- OddPages;
- EvenPages;
- RepeatedBand. This value refers to a band with the
RepeatOnEveryPage
property set to true; - SinglePage - the report must be double-pass.
By default, the value of this property equals to FirstPage, LastPage, OddPages, EvenPages, RepeatedBand, SinglePage
. This means that the object will be printed on all pages of the report. In case the report has single page only, the object's visibility is determined by the SinglePage
value only.
We will give several typical examples of using this property:
Property value | Where the object will be printed |
---|---|
FirstPage | Only on the first page. |
LastPage, OddPages, EvenPages, RepeatedBand | On all pages except the first. |
FirstPage, OddPages, EvenPages, RepeatedBand | On all pages except the last. |
RepeatedBand | Only on bands with the RepeatOnEveryPage property is set to true . |
FirstPage, LastPage, OddPages, EvenPages | On all bands except the repeated one. |
FirstPage, LastPage, OddPages, RepeatedBand | Only on odd pages. |
FirstPage, LastPage, EvenPages, RepeatedBand | Only on even pages. |
Note: Even and odd pages are determined by the page number in the rendered report, that counts pages starting from 0. For example, the second page displayed in the preview will be odd because its number in the rendered report is 1.
For example, to print different text on odd and even pages, put two "Text" objects on a band and setup them in the following way:
- the first object will be printed on odd pages. Set its
PrintOn
property toFirstPage, LastPage, OddPages, RepeatedBand
(i.e. all values exceptEvenPages
). - the second object will be printed on even pages. Set its
PrintOn
property toFirstPage, LastPage, EvenPages, RepeatedBand
(i.e. all values exceptOddPages
).
These objects will never be printed at the same time. You could place them on top of each other.
All bands have the same property. To print different bands on odd and even pages, use the "Child" band. You can attach it to any band; this can be done in the "Configure Bands" window. Setup the main band and its child in the following way:
- the main band will be printed on odd pages. Set its
PrintOn
property toFirstPage, LastPage, OddPages, RepeatedBand
(i.e. all values exceptEvenPages
). - the child band will be printed on even pages. Set its "
PrintOn
" property toFirstPage, LastPage, EvenPages, RepeatedBand
(i.e. all values exceptOddPages
).
Bands can have different height, appearance and contents. Look at the following example which prints different page headers: