Conditional
formatting in XML publisher can be handled by If and while statements
- If Statement
- <?if:COLOR='RED'?>Y<?end if?>
- If-then-Else
- <?if:COLOR='RED' then Y else N end if?>
- Nested
If-then-Else
<?if:COLOR='RED' then Y else if COLOR = 'BLUE' then B else N end if?>
Combining
If with <?xdofx:expression?> helps in scripting SQL statements.
Refer below.
- Choose
- <?choose:?>
<?when:expression?>
<?otherwise?> - Example
<?choose:?>
<?when:CLOLOR = ‘RED'?>
'Y'
<?end when?>
<?when:COLOR = 'B'?>
'B'
<?otherwise?>
'N'
<?end otherwise?>
<?end choose?>
BI Publisher has extended
a set of SQL and XSL functions for use in RTF templates. The syntax for these
extended functions is
<?xdofx:expression?>
--> for extended SQL functions or
<?xdoxslt:expression?>
--> for extended XSL functions
- <?xdofx:if COLOR ='Y' then substr('ACCEPTED',1,6) else REJECT end if?>
Refer --> Exteneded Functions