IF Condition in RTF template| BI Publisher if xdoxslt:get_variable

IF Condition in RTF template

When you create a BI Publisher template, you can add conditional statements to determine whether or not a condition is true or false. IF Condition in RTF template allows you to perform actions only when certain conditions are met. For example, you might want to display a message only when the value of a field exceeds a certain threshold.

The syntax

We can use if condition directly in xml publisher by writing <?IF?> condition <?END IF?>

Example: <?if :rate>0 ?> Yes <?end if?>

But for If-else we need to use extended function.

Method 1:

<?xdofx:if element_condition then result1 else result2 end if?>

Example:

<?xdofx:if PO_AMOUNT > 15000 then ’Costly’
else
if PO_AMOUNT <5000 then ’Cheaper’
else
’Equal’
end if?>

Method 2:
Syntax:

<?xdoxslt:ifelse(condition,true,false)?>

Example: 

<?xdoxslt:ifelse(1=2,’yes 1 is equal to 2’,’No 1 is not equal to 2’)?>

The result of the above expression is
No 1 is not equal to 2

if xdoxslt:get_variable

Using this for a variable

for e.g if counter variable is greater than 0 print 22 else print 33

<?xdoxslt:ifelse((xdoxslt:get_variable($_XDOCTX, ‘counter’))>0,22,33)?>

Using OR Condition in XML RTF Template:

Syntax:

<?if:XMLfield=value1 or XMLfield=value2?> display value <?end if?>

Example:

<?if:sum(AVALUE)=0 or sum(BVALUE)=0?>0<?end if?>

Inserting Choose Statements


Use the choose, when, and otherwise elements to express multiple conditional tests. If certain conditions are met in the incoming XML data, then specific sections of the template are rendered. This is a very powerful feature of the RTF template.


Use the following syntax for these elements:

<?choose:?>

<?when:expression?>

<?otherwise?>

Recommended post

Variables in BI Publisher RTF template

Bursting in Fusion BIP

more on Fusion apps tech

wpsbutton
We will be happy to hear your thoughts

Leave a reply

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock
Cloud Technologies Blog
Logo
Compare items
  • Total (0)
Compare
0
Shopping cart