XML Publisher supports the common programming
construct "if-then-else". This is extremely useful when you need to
test a condition and conditionally show a result.
Use the following syntax to construct an
if-then-else statement in your RTF template:
<?xdofx:if element_condition then result1 else
result2 end if?>
For example, the following statement tests the INVOICE_AMOUNT
element value. If the value is greater than 5000, show the word
"Higher"; if it is less than 3000, show the word "Lower";
else, show "Equal":
<?xdofx:if INVOICE_AMOUNT > 5000 then
’Higher’
else
if INVOICE_AMOUNT <3000 then ’Lower’
else
’Equal’
end if?>
Here we are using same RTF and RDF
which we had used in IF statement
RTF looks like
Provide proper text and Click on Add Help Text we will get another pop
window which is shown below
There we have to write below code
Which is shown below
Now we have to publish the report
Click on Template Builder => Preview =>
HTML/PDF/Excel/RTF (any format).
We can get below output
This comment has been removed by the author.
ReplyDeleteHi Ragavan,
ReplyDeleteThanks for the excellent solution.
Noor