• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

If Then Else Endif

DBohner-(db)

Legendary Poster
Howdy,

I'm looking for a couple of syntax examples of how to use IF/THEN/ELSE/ENDIF syntax withing BIP. I see the Oracle Docs that say it is do-able, however I can't find any examples (or I am looking in the wrong docs).

Thanks in advance

(db)
 

DBohner-(db)

Legendary Poster
Hi X,

I've read the "Syntax" statement, exactly as written. What I'm looking for is a real-life example of what that looks like.

For example:
- Condition: (If value = A or Value = B)
- Result 1: Print "The Value is A"
- Result 2: Print "The Value is B"

I believe there is additional syntax that goes behind the 'element_condition' and 'results'... that I'm missing.

Being Stupid

(db)
 

xxpeta

Active Member
Hi,
or you can use this:
<xsl:if test="(A='1' or A='2') and B='3'">
output_my_stuff
</xsl:if>

or you can choose:
<?choose:?>
<?when:.//LanguagePreference_ID158='C'?><?xdoxslt:set_variable($_XDOCTX,'LNGP','C')?><?end when?>
<?when:.//LanguagePreference_ID158='G'?><?xdoxslt:set_variable($_XDOCTX,'LNGP','G')?><?end when?>
<?otherwise:?><?xdoxslt:set_variable($_XDOCTX,'LNGP','E'))?><?end otherwise?>
<?end choose?>
 

cribeiro

Member
I guess it would depend the output you need. xml, pdf, excel, txt, etc.
If you're looking to have a xml output for instance, you will need to work w/ a XSLT and then you can play using IF or CHOOSE, and you can add variables or even some smart functions as contains (not(contains) - concat, many others.
If Excel - you can play in XDO_METADATA and you can add columns w/ Excel formulas and conditions.
For the RTF you have the replies here from @xxpeta, but going to the properties and use some IF or Choose, like,<?if:paymentInstrument='01'?>CASH<?end if?>
For eText you can play by field and use the IF or Choose, like: IF DocumentPayItem_ID10 = ‘001’ AND AmountGross_ID70 < 0 THEN ‘001’ ELSE DocumentPayItem_ID10 END IF

Good luck!
 

johnd

Member
This is what did

In the page =header I had
<?call:Logo?>


then lower down I had



<?template:Logo?>


<?choose:?>

<?when: CostCenter_ID242=' 215S'?> JPEG inserted <?end when?>



<?when: CostCenter_ID242=' 215'?> JPEG 2 inserted <?end when?>

<?otherwise:?> <?end otherwise?>

<?end choose?>

<?end template?>
 
Top