Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 16 Oracle Analytics Lounge
- 216 Oracle Analytics News
- 43 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 79 Oracle Analytics Trainings
- 15 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
How to Insert a Blank Page After an Odd Numbered Account Statement in BI Publisher

Hello Oracle Community,
I am working on a project where I need to generate PDF statements for account records using Oracle BI Publisher. The data is provided in XML format, and the templates are in RTF. The issue I'm facing is related to duplex printing for account statements. Specifically, I need to ensure that if an account’s total number of pages is odd, a blank page should be added after that account. This is important as we are printing duplex, and the next account should begin on the reverse side of the last page.
I have the following logic in my RTF template for the page break insertion:
xmlCopy<?if:not(position() = last())?> <?if:xdoxslt:get_variable($_XDOCTX, 'pgcount') mod 2 = 1?><fo:block break-after="page"/><?end if?><?end if?>
Current Behavior:
- The condition checks if the page count (
pgcount
) is odd (mod 2 = 1
), and inserts a page break after each odd account. - However, this does not seem to handle the insertion correctly for odd-numbered account pages. Instead, it may add the page break at the wrong time (e.g., after even accounts or possibly the last account).
The desired behavior:
- If the total pages for an account statement are odd, I need to insert a blank page after that account (before moving to the next account).
- If the total pages for an account statement are even, no blank page should be added.
My Question:
- Is the current logic correct for inserting a blank page after an odd number of pages? If not, what changes should I make?
- What is the proper syntax and method to ensure that BI Publisher inserts a blank page only after accounts with odd pages?
- Should I be using a different approach for page counting or break insertion to ensure that the page numbering works as expected for duplex printing?
Any guidance or examples would be greatly appreciated!
Thank you in advance!
Answers
-
Page number calculations do not work as we build output in two stages and the page numbers are not calculated until the second pass.
See the manual End on Even or Odd Pages
Rgds,
Kevin
0