BI Publisher – How to use IF-Then -Else Condition in rtf Template

We have already seen how to use IF conditions in rtf.

But what happens when we have to use IF-THEN -ELSE conditions?

It could be used in the following way

Syntax of If else Condition is
<?xdoxslt:ifelse(condition,true,false)?>

Example:

<?xdoxslt:set_variable($_XDOCTX, ‘A’, 0)?>
<?xdoxslt:set_variable($_XDOCTX,’A’,xdoxslt:ifelse(xdoxslt:to_number(CS_VALUE)=’1′, 100, 200))?>
<?xdoxslt:get_variable($_XDOCTX,’A’)?>

Where CS_VALUE is a Summary column whose value is 1

A is a variable.

The above would print 100.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s