• Welcome to the upgraded JDELIST forum and thank you for your patience.
    Please restrict discussions and issues regarding the new forum software to the Off Topic forum. We will be monitoring that forum for issues.
    If you have trouble logging in, please reset your password using the forgotten password form: https://www.jdelist.com/community/index.php?lost-password/
    If you are unable to successfully reset your password, please contact us: Click here!
    We hope that you enjoy the upgraded forum.
  • 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

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)
 
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

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!
 
Top