Oracle Analytics Cloud and Server

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

conditional layouts in one rtf template in BI publisher

Received Response
910
Views
8
Comments

Summary

conditional layouts in one rtf template in BI publisher

Content

Hi All,

I need to develop rtf template which includes 2 layouts in one rtf file.

Meaning, conditional layouts

I am attaching sample doc for this.

If CF_FLAG=’Y’ then layout should print header and footer details in every page.

If CF_FLAG=’N’ no header and footer required

image

Can you please provide sample/help me on this how to develop ?

Thank you very much!

Answers

  • Christian Thibaudeau-90201
    Christian Thibaudeau-90201 Rank 5 - Community Champion

    Hi there, Word in managing line printing. Nevertheless, when it comes to total at the end, it becomes a bit tricky.

    If you want you total always at the same place on different pages, you'll have to use line counter to Limi lines per page.

    There's a couple of example on the web on how to use line counter.

    - https://myoracleappsworld.wordpress.com/2014/06/19/limiting-lines-per-page-and-fixed-length-table-in-xmlbi-publisher-rep…

    In the header and footer, you can't use field to hide the code , so you have to code and it could become quickly messy.

    Also, you may use Template in your doc

    For example, at the very bottom of your rtf document, write :

    <?template:LQ_FOOTER?>

      insert your code here...it could be a table with image, sub total, etc.

    <?end template?>

    In the body or let say in the footer, just write

    <?call:LQ_FOOTER?>

  • Jean Garcia Melgares
    Jean Garcia Melgares Rank 3 - Community Apprentice

    Hello,

    Changing header/footer means changing section in word. I've tried to make conditionnal section in rtf template, but never works. Conditionnal page break works, but for me, conditionnal section break no.

    But has that changed in newer versions of bi publisher

    (sorry for my english)

    regards

  • Rajesh123
    Rajesh123 Rank 6 - Analytics Lead

    could you please send me that rtf template if you have

  • User910243567
    User910243567 Rank 6 - Analytics Lead

    This is pretty much similar to conditional display in below blog. Make sure CF_FLAG is in outermost  group.

    https://myoracleappsworld.wordpress.com/2013/11/08/bi-publisher-conditional-display-of-the-template-region/

  • Rajesh123
    Rajesh123 Rank 6 - Analytics Lead

    Thank you very much for early reply!

    But how to handle multiple lines for cf_flay=Y layout? how about header and footer(print bottom of the page)?

    please let me know if any questions or comments!

    i have tried to put 2 layouts in rtf template based on  Flag values , it is working fine when the data has not more than 35.

    If the lines are more then 35 , i mean 50 lines ,it is printing in 2nd page , but its format is not good(The total section is printing on middle of the 2nd page not bottom of the page)

    Thanks again!

  • Christian Thibaudeau-90201
    Christian Thibaudeau-90201 Rank 5 - Community Champion

    Hi, you’re right; template will be called on each page if it’s in the footer.

    The easiest way is probably to have two body/layouts in one rtf to avoid calling problems.

    So, let say you have an rtf document

    1. On physical page 1 of the word
      document, structure it this way :

    a- Header

    b- Body

                In
    this section, place something like

    <?choose:?>

    <?when: CF_FLAG = ‘Y’?><?call:template1?><?end when?>

    <?when: CF_FLAG = ‘N’?><?call:template2?><?end when?>

    <?otherwise:?> <? call:template1?><?end otherwise?>

    <?end choose?>

                

    c - Footer

    1. - On physical page 2 of word document,

    <?template:template1?>

    all the text that need to be shown in template1

    <?end template?>

    <?template:template2?>

    all the text that need to be shown in template2

    <?end template?>

  • Rajesh123
    Rajesh123 Rank 6 - Analytics Lead

    Thank you Chris.

    If i use template cal in footer it will repeat in all pages as well as it will effect to CF_FLAG 'N' layout as well correct?

    i am having format issue, if i have more than 1 page lines, per one parameter, the output is not look and feel type.

    how to handle 2 layout in one rtf template?

    I have tried like below:

    CF_FLAG 'N' in 1 rtf template created in oracle xml admin like a sub-template

    CF_FLAG 'Y' in another 1 rtf template created in oracle xml admin like a sub-template

    called above 2 sub-templates in one main templates.(see below)

    <?import:xdo://XTEST.CF_FLAG_N.en.00?>

    <?for-each@section:G_DET?>

    <?choose:?>

    <?when://CF_FLAG!="Y"?>

    <?call-template:FLAG_N?>

    <?end when?>

    <?end choose?>

    <?end for-each?>

    I am able to call only one sub-template.

    but how to handle below condition based templates, in main template.

    <?when://CF_FLAG="Y"?>

    <?call-template:FLAG_Y?>

    <?end when?>

    <?when://CF_FLAG!="Y" and //CF_FLAG="Y"?>

    <?call-template:FLAG_N?>

    <?call-template:FLAG_Y?>

    <?end when?>

    can you please help me on this?

  • Rajesh123
    Rajesh123 Rank 6 - Analytics Lead

    Suppose,

    On physical page 1 of the word

    --Header details

    --Header details

    --Footer Details

    On physical page 2 of the word

    It has T&C type description/values based on FLAG tag.

    If i use your way

    <?when: CF_FLAG = ‘Y’?><?call:template1?><?end when?>

    <?when: CF_FLAG = ‘N’?><?call:template2?><?end when?>

    So, the page 2 of the word CF_FLAG=N also printting first layout header and footer details correct?

    Can u please send me Ur email id?

    Thank you very much!!