BI Publisher for MS Word - if else condition for paragraph — Oracle Analytics

Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

BI Publisher for MS Word - if else condition for paragraph

Received Response
146
Views
2
Comments

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

  • timdexter
    timdexter Rank 6 - Analytics Lead

    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

  • Venkat Thota - BIP
    Venkat Thota - BIP Rank 7 - Analytics Coach

    share your template and xml , will help you out. Thanks