Categories
- All Categories
- Oracle Analytics and AI Learning Hub
- 40 Oracle Analytics and AI Sharing Center
- 20 Oracle Analytics and AI Lounge
- 276 Oracle Analytics and AI News
- 50 Oracle Analytics and AI Videos
- 16.2K Oracle Analytics and AI Forums
- 6.4K Oracle Analytics and AI Idea Labs
- Oracle Analytics and AI User Groups
- 102 Oracle Analytics and AI Trainings
- 17 Oracle Analytics and AI Challenge
- Find Partners
- For Partners
BI Publisher for MS Word - if else condition for paragraph
Summary
BI Publisher for MS Word - if else condition for paragraph
Content
Working on a report where I would use a if else conditions for certain data and XML fields to appear/disappear. I have looked into XSL, XDO and FO functions but I keep running into fundamental errors among them. Essentially, I'm looking for functions to handle a paragraph with a header, text and XML elements to appear if condition is met and not appear at all if condition is not met.
Ex.
If A.PLAN_TYPE = 1
output:
COVERAGE
Your plan type XMLfield 1 expires on XMLfield2
and
else A.PLAN_TYPE != 1
output:
(blank)
I have tried multiple ways of doing this and have struggled getting the underline to appear, tried doing it with xsl but no luck. If there is any resources out there that would be helpful as well.
Answers
-
If you have lots of plan types that you need to manage. It might be better to break them all out into a separate document and call them dynamically to be pulled in.
Blog post I wrote a while ago here: https://blogs.oracle.com/xmlpublisher/conditional-templates
If it is only a few types then you might need to investigate the @inline feature. So your if statement would become
<?if@inline: A.PLAN_TYPE = 1?>
output:
COVERAGE
Your plan type XMLfield 1 expires on XMLfield2
<?end if?>
<if@inline: A.PLAN_TYPE !=1?>
abc
def
<?end if?>
I know its repetitive with the ifs but XSL does not do ELSEs very well. You could also use a choose statement.
Cheers
Tim
0 -
share your template and xml , will help you out. Thanks
0