Oracle Analytics Publisher

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

How to Insert a Blank Page After an Odd Numbered Account Statement in BI Publisher

Received Response
11
Views
1
Comments

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:

  1. Is the current logic correct for inserting a blank page after an odd number of pages? If not, what changes should I make?
  2. What is the proper syntax and method to ensure that BI Publisher inserts a blank page only after accounts with odd pages?
  3. 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