Transaction receipt A4 (.irt) , conditionally displaying page/section

Transaction receipt A4 (.irt) , conditionally displaying page/section

Problem statement :

There is need to make some  adjustments  in the default transaction print A4( .irt based) .Depending on the transaction mode of the pos, a different page, or multiple pages have to be printed. Eg, when a transaction contains a sale and a ARpayment, 2 page's have to be printed.
When only a sale - only the sale page 
when only a ARPayment - only the ARPayment 
Therefore it is required to use some scripting in the "print event" - before print to override the system based on the database query.
Based on the result of the query, the page print would be disabled.

Environment : 

iVend 6.5 Update 4 with SAPB1 9.2

Symptoms : 

NA

Resolution/Workaround :

There is  need to hide or show   page on  report designer Based on Transaction-wise. To show the specific transaction based on Transaction type , below configurations can be used :