Complex if statement in rtf template?

Hello,
I want to build an if statement in rtf template, the idea is like:
<?if:address!='' and phone!=''?>
<?end if?>
what's the correct way to do it if it is possible? Thanks in advance!
Shichao

stevencallan wrote:
Conditional statements, in the user guide or the report developer guide, depending on the version you use.
Page 7-62 in the 10.1.3.2 user guide:
Use an if statement to define a simple condition; for example, if a data field is a specific value.
1. Insert the following syntax to designate the beginning of the conditional area.
<?if:condition?>
2. Insert the following syntax at the end of the conditional area: <?end if?>.
For example, to set up the Payables Invoice Register to display invoices only when the Supplier name is "Company A", insert the syntax <?if:VENDOR_NAME='COMPANYA'?> before the Supplier field on the template.
Enter the <?end if?> tag after the invoices table.Thanks for the reply. But what about two conditions in one if statement? That was my question. :)
Shichao

Similar Messages

  • Choose statement in rtf template

    Hi Gurus!
    I'm building a report on rtf template (Bi Publisher Addin for MSword).
    If I insert a "Choose statement", every time I run the report the content of choose go on a new row.
    I want to avoid this behavior and that the "choose" is show on the row where i put it in the template builder.
    Any Idea?
    Regards,
    Daniele

    not exactly a guru, but have you investigated using the @inlines context in your template?
    e.g.
    My condition was <?choose@inlines:?><?when@inlines:MY_CONDITION='1'?>One<?end when?>
    <?when@inlines:MY_CONDITION='2'?>Two<?end when?>
    <?otherwise@inlines:?>something completely different<?end otherwise?>
    <?end choose?>

  • Error: If statement in RTF template in BI Buplisher

    All,
    Can some help me to solve the below issue. Please find the code below one which is extracted from the water mark block in RTF template.
    <?if:(sum(//g_data[fiscal_period=/asset/p_fiscal_period]/q2_op_plan_ytd))>0?><?( sum(//g_data[fiscal_period=/asset/p_fiscal_period and q1_task_top="Opex"]/q1_cost_plan_ytd) ) div
    *(sum(//g_data[fiscal_period=/asset/p_fiscal_period]/q2_op_plan_ytd) ) ?><?end if?>*
    I wanted to apply if condition to the code after the " div " as if I get any value for q2_op_plan_ytd as zero the it should replace with 1.
    Please help me on this

    Solution found.

  • BI Publisher : SELECT statement in RTF template

    Hi Guys
    I have written a BI Publisher Report using XML file created from Oracle Reports(in Oracle Apps).
    Repors runs from Oracle Apps perfectly ok. Now I need to fetch some data from couple of tables and display on the Report.
    I am wondering whether I can directly code SELECT statement in RTF file rather than messing with Oracle Report(.rdf) file.
    Please advise.
    Thanks and Regards
    Vijay

    Hey Vijay,
    You cannot query in RTF using select :)..
    You have to mess/play with RDF to do it ;)
    Oh wait, did i say , we cannot in RTF, we can , but that is difficult approach to go with., keep this as an end of the world option.

  • And/or if statement in rtf templates.

    Hi all,
    I'm using XML Publisher 4.5.
    I have created a word template file (rtf) for my reports. I need to be able to show some content in the template file by using and and/or if statement.
    fx. <?if:doc_type='STANDARD'?> OR <?if:doc_type='DEFAULT'?>
    How can I do this?
    In advance thank you.
    Best regards
    Kenneth

    Hi D,
    Thank you for your answer.
    I have seriously thought about that solution; but I don't think it's a smart way to do it.
    If i do it like that, i need to copy the whole table and paste it inside the if statements.
    I have two xml elements that I need to make the decisions on. POH_PO_TYPE & CP_RELEASE_NUM.
    POH_PO_TYPE can be: STANDARD, RELEASE or BLANKET.
    CP_RELEASE_NUM can be: '' or N
    If POH_PO_TYPE is RELEASE AND CP_RELEASE_NUM is not ''
    OR POH_PO_TYPE is STANDARD
    OR POH_PO_TYPE is BLANKET AND CP_RELEASE_NUM is ''
    THEN show table (which contains the whole PO).
    It shall show the content of the PO in any of these cases.
    BR Kenneth

  • How to select specific rows in rtf template for complex calculation

    Hi,
    I want custom calculation in my rtf template and for this i need to select specific cell's value OR specific row's value. Any one please suggest how can I get this. Below is the example i have plotted using excel. My target is to get field 8 and 9 using sum and minus. We can calculate column over column, is there any way to calculate row over row? If I use variables, then i have to create so many variables because I have more columns and rows to calculate (here i posted one sample table). Any one please help me how can I get expected result other than using variables! If "Using variables" is the only way then also give your valuable opinions.
    Row No
    Curr Qtr
    PQtr1
    PQtr2
    3
    B3
    C3
    D3
    4
    B4
    C4
    D4
    5
    B5
    C5
    D5
    6
    B6
    C6
    D6
    7
    B7
    C7
    D7
    8
    B8=SUM(B4:B7)
    C8=SUM(C4:C7)
    D8=SUM(D4:D7)
    9
    B9=B8-B5
    C9=C8-C5
    D9=D8-D5
    Thanks.

    Hi AlexAnd,
    Thanks for the reply, I got 0 using both codes. This is a dummy table and I plotted 3,4 to give an idea of row number (as like as excel). Rows are individual data sets combining different measures and dimensions with different values.
    Account
    Curr_Qtr
    PQtr1
    PQtr2
    Deposit
    10
    15
    20
    Loan
    15
    20
    25
    Earning
    20
    25
    30
    Assets
    25
    30
    35
    Total
    =SUM(15,20)
    =SUM(20,25)
    =SUM(25,30)
    Expense
    =SUM(15,20)-25
    =SUM(20,25-30
    =SUM(15,20)-25
    Is there any way to identify the range or individual cell's value? Using variables I have to create lots of variables for each cells, I want to avoid that and want to use rows in calculation! Is that possible, Pls share your valuable opinions!
    Thanks.

  • Complex Header on RTF Template

    Hello all,
    I have an issue with an RTF template and I really hope you have a minute to help me out.
    I'm really new at this stuff. This is for Purchase Order (PO) printing on Oracle eBusinesss Suite.
    On the template I need the first rows from a table (which represents the PO number) to be repeated for each page when the number of rows on the table exceeds one page. Those rows are inside a for-each.
    I've tried:
    1. using Word Header, it won't let me put form fields, so I've tried with the XMLtag for the fields, but it allways repeat the first one when more than one PO exists.
    2. using Word Repeat Header Rows property, works fine with just one PO, but doesn't work for more than one.
    3. using <?start:body?> <?end body?> gives me an error, changed for <?body-start?> <?body-end?> which gave me no error but doesn't do anything.
    Could I have a version issue? I'm working with Oracle BI Publisher Template Builder for Word 10.1.3.4.1. and XMLP 5.6.3 on eBS 11i.
    Really appreciate if you shed a light over this.
    Thanks!

    Thanks for your reply, I think you understood the problem.
    We've tried what you suggested, but didn't work.
    It keep on repeating the first PO_NUM on every page, for the field above the start:body.
    The PO_NUM bellow the start:body (inside the for-each) is iterating OK as expected.
    This is what it looks like now:
    THIS IS MY HEADER
    <?POH_PO_NUM?>
    <?start:body?>
         <?for-each-group@section:G_HEADERS;./POH_PO_NUM?>
              <?POH_PO_NUM?>
              <?for-each:G_LINES?>
                   <?POH_LINE_QTY?>
              <?end for-each?>
              <?split-by-page-break:?>
         <?end for-each-group?>
    <?end body?>
    Any suggestion? I'm I missing something?
    Thank you very much!

  • Resetting Header and Footer in RTF templates

    Hi,
    I developed an RTF template (template 1). This template contains start:body and end body for printing the header and footer in all pages. After printing this template then i have to call another template(template 2) from this. I called the template (template 2) using call statement. But the probelm is that the header and footer of template1 is printed in the output of template2 .
    I dont want to print this header and footer for template 2. Can anyone please suggest me in doing this. I placed start:body and end body in the second template with the assumption that 1st template's header and footer will be overwritten. But if i preview then am getting the error
    Font Dir: C:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\Documents and Settings\kpoda\Desktop\Invoice Printing Efficiencies\Sample XML Data\Sample Output4.xml
    FOProcessor setLocale: en-us
    each
    Please sugget.
    Thanks

    Hi,
    Do you have two templates (template1 & template2) that you want to display in the same document where the pages for template1 has one set of header and footers; and template2 has another set of header and footer?
    If that is the case you can simply create a new section in your rtf template so you have section1 and section2.
    In the body of section1 you call template1 and template2 in the body of section2.
    You can then have different header and footers for the two templates in the same document.
    BR Kenneth

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates.
    My requirement is :
    create table xxinv_item_pei_taginfo(item_id number,
    Organization_id number,
    item varchar2(4000),
    record_type varchar2(4000),
    record_value CLOB,
    State varchar2(4000));
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
    insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
    select * from xxinv_item_pei_taginfo;
    Item id Org Id Item Record_type Record_value State
    493991     224     1265-D30     USES     fever     TX
    493991     224     1265-D30     HOW TO USE     one tablet daily     TX
    493991     224     1265-D30     SIDE EFFECTS     XYZ     TX
    493991     224     1265-D30     DRUG INTERACTION     ABC     TX
    493991     224     1265-D30     OVERDOSE      Go and see doctor     TX
    493991     224     1265-D30     NOTES     Take after meal     TX
    Above is my data
    I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
    In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
    its a BI Publisher report.
    please suggest

    if you have data in db then you can create xml with needed structure
    and so you can create bip report
    do you have errors or .... ?

  • Insert Image in RTF Template Conditionally

    Can an image be inserted into an RTF Template using an If-Then statement? Like this:
    <?if:FIELD1='IMAGE1' 'insert IMAGE1' else 'insert IMAGE2'?>
    If this is possible what syntax needs to be where the example says 'insert IMAGE1'? The images are jpg files that exist on a local PC but the template will run on a Unix machine.
    Is there a way to do this? Thank you very much.
    James

    you can try like this
    <?template:image?>
    <?if:FIELD1='IMAGE1'?>
    IMAGE1
    <?end if?>
    <?if:FIELD1!='IMAGE1'?>
    IMAGE2
    <?end if?>
    <?end template?>
    use this tag where u need image <?call:image?>
    for image location or dynamic images check these links
    https://blogs.oracle.com/xmlpublisher/entry/dynamic_images
    https://blogs.oracle.com/xmlpublisher/entry/one_of_our_images_is_missing
    http://learnobi.blogspot.com/2012/08/dynamic-image-in-rtf-of-oracle-bi.html
    Signature image on template

  • "Or" condition in RTF Template

    Hello,
    In my RTF template, I try to test a statement for two values. I tried
    <?xdofx:if :A!='0' or B!= '0'?>
    <?if:A!='0' or B != '0'?>
    It doesn't work : there isn't any error but the result is wrong.
    Is there another syntax I've got to use ?
    Thanks
    Version : BI Publisher 10g
    Edited by: jbg on 4 oct. 2011 23:49

    Condition usage looks fine.
    Do these conditions individually work? Whats is your requirement?
    If possible paste a sample xml here

  • Issue in RTF Template

    Hi All,
    Could you please solve the following requirement:
    Requirement: In my RTF Template for the fisrst page we are displaying parameters of the report.
    In the second page we have 2 tables one is for statement and other one is for Receipt.
    My requirement is in the second page i need to display "statement table" at the starting of
    second page[i.e @Header part] and "receipt table" at the end of the second page[i.e @tailor part].
    My issue is if statement table is having many rows some of the rows are skipped and displayed at 3rd page.and the receipt table is @ 2nd page.
    If receipt table is having many rows it is breks into two dispalyed at the end of second page and starting of 3rd page.
    Can anyone please provide me the solution.
    Thanks in Advance,
    Dhanasurya
    Edited by: DhanaSurya on Nov 6, 2009 1:06 AM

    Hi Dhanasurya,
    It sounds like you are using headers and footers, and that what you seeing is standard expected functionality.
    You could try extending your header/footer regions to make them bigger, but if there are too many rows of course then the tables will break across pages.
    Depending on your requirements you could limit the number of rows so they always if on one page, otherwise you'd need to either accept the data will break across pages, or implement something like Fixed Row Enumeration.
    Regards,
    Gareth

  • Variables in RTF template?

    Variables in RTF template?
    I am battling with variables in RTF template.
    (1) I need to declare and set a variable.
    (2) I like to print it out - check for value
    (3) then I need to make some conditional formatting IF-THEN-ELSE depending on variable value
    THIS DON'T WORK AT ALL (1,2,3):
    (1) declare a variable
    <xsl:variable name="MYCOUNT" select="count(LINE_LOCATIONS/LINE_LOCATIONS_ROW/SHIPMENT_NUM)"/>
    (2) print-out-a-value
    <xsl:value-of select="$MYCOUNT"/>
    (3) IF-THEN-ELSE statement
    <xsl:if test="$MYCOUNT > 1"><xsl:value-of select="concat('mo','re')"/></xsl:if>
    <?if:MYCOUNT="1"?><xsl:value-of select="concat('o','ne')"/><?end if?>
    THIS WORK (1,2) BUT (3) don't work in any way !!!
    (1) declare a variable
    <?xdoxslt:set_variable($_XDOCTX, MYCOUNT, count(LINE_LOCATIONS/LINE_LOCATIONS_ROW/SHIPMENT_NUM))?>
    (2) print-out-a-value
    <?xdoxslt:get_variable($_XDOCTX, MYCOUNT)?>
    (3) IF-THEN-ELSE statement
    <?xdofx:if MYCOUNT=1 then 'one' else 'more' end if?>
    <?xdofx:if $MYCOUNT=1 then 'one' else 'more' end if?>
    <?xdofx:if xdoxslt:get_variable($_XDOCTX, MYCOUNT)=1 then 'one' else 'more' end if?>
    Can someone help me haw to compare a value of variable with constant or another variable or node-value ?
    thx.

    <?xdoxslt:set_variable($_XDOCTX, ‘COUNT’,’YY’)?>
    <?xdoxslt:get_variable($_XDOCTX, ‘COUNT’)?>
    <?if:(xdoxslt:get_variable($_XDOCTX, ’COUNT’)) = ‘YY’?> YEss<?end if?>
    <?if:(xdoxslt:get_variable($_XDOCTX, ‘COUNT’)) = ‘HH’?> Helooo<?end if?>
    <?xdoxslt:set_variable($_XDOCTX, ’YY’, 15)?>
    <?xdoxslt:get_variable($_XDOCTX, ’YY’)?>
    <?if: (xdoxslt:get_variable($_XDOCTX, ’YY’))=15?>Yes Yes<?end if?>
    Variable name is 'COUNT'

  • Problem with IF THEN ELSE in RTF template

    HI ALL,
    I have two layouts in the RTF template. Based on the parameter value it has to show the value.
    For example if P_State='United States' then first layout should come. else second one should come.
    I tried to use the IF Then else logic through the form field but i am getting error.
    Please help on this to get it.
    Regards
    Boopathi

    You can do that.
    i guess, the syntax you are using is wrong.
    please refer documentation or this forum for choose:
    Use choose statement. it s better.
    Or send me the template to my id in my profile. or upload it here http://apps2fusion.com/forums/viewforum.php?f=60

  • PDF formating issue in RTF Template

    Hi,
    I have an XML for which i have data for both subavisor level and fund level and the data at each fund level are derived/aggregated from Subadvisor level(using complex formula which is taken care at the database level not at the RTF level).
    I need to show both Fund level data and SubAdvisor level data in the report, so i have designed the required RTF Template to show the Sub Advisor level data for each fund Level Data.
    The Sample XML is(i have only included one SubAdvisorLevel data(XYZ) for the Fund(ABC) :
    <DATA_DS>
    - <G_1>
    <FUND_NAME>ABC</FUND_NAME>
    <SUB_ADV_ANA_MIL>1234</SUB_ADV_ANA_MIL>
    <MGMT_FEE_PAID>1234</MGMT_FEE_PAID>
    <MGMT_FEE_PAID_O>NA</MGMT_FEE_PAID_O>
    <MGMT_FEE_BP>1234</MGMT_FEE_BP>
    <MGMT_FEE_BP_O>NA</MGMT_FEE_BP_O>
    <TA_BILLABLE_ASSET>NA</TA_BILLABLE_ASSET>
    <TA_FEES_PAID>NA</TA_FEES_PAID>
    <TA_FEES_PAID_O>NA</TA_FEES_PAID_O>
    <TA_EFF_BP>NA</TA_EFF_BP>
    <TA_EFF_BP_O>NA</TA_EFF_BP_O>
    </G_1>
    - <G_1>
    <FUND_NAME>ABC</FUND_NAME>
    <SUB_ADV_NAME>XYZ</SUB_ADV_NAME>
    <SUB_ADV_ANA_MIL>123</SUB_ADV_ANA_MIL>
    <MGMT_FEE_PAID>123</MGMT_FEE_PAID>
    <MGMT_FEE_PAID_O>NA</MGMT_FEE_PAID_O>
    <MGMT_FEE_BP>123</MGMT_FEE_BP>
    <MGMT_FEE_BP_O>NA</MGMT_FEE_BP_O>
    <TA_BILLABLE_ASSET>NA</TA_BILLABLE_ASSET>
    <TA_FEES_PAID>NA</TA_FEES_PAID>
    <TA_FEES_PAID_O>NA</TA_FEES_PAID_O>
    <TA_EFF_BP>NA</TA_EFF_BP>
    <TA_EFF_BP_O>NA</TA_EFF_BP_O>
    </G_1>
    - <G_1>
    Because of this structure the XML, i have designed the RTF template by putting the following code:-
    <?for-each-group:G_1;./FUND_NAME?><?sort:current-group()/FUND_NAME;'ascending';data-type='text'?>
    <?FUND_NAME?> <?SUB_ADV_ANA_MIL?> ............................................(other Attributes are also present)
    <?for-each-group:current-group();./SUB_ADV_NAME?> <?if:SUB_ADV_NAME!=''?> <?SUB_ADV_ANA_MIL?>............(other Attributes are also present)
    <?end if?><?end for-each-group?>
    The only issue i am facing while exporting this RTF Template to PDF is that i am getting a blank row in the PDF(because of the condition <?if:SUB_ADV_NAME!=''?> ) for the 1st level of Sub Advisor level Grouping and there after all the Sub Advisor level data are coming up fine.
    Can you please help me out in resolving this issue

    Thanks Bipuser,
    But the inlines function in not giving the desired result, it is working in the same way even if i haven't put any condition.
    The problem with the existing condition <?if:SUB_ADV_NAME!=''?> is that only PDF is generated with the extra space and Excel does not comes up any space.
    Please let me know if you need any further information from my end.
    Thanks again,
    Regards
    Mrinal

Maybe you are looking for

  • LaserJet Pro 500 color printing quality

    Hi, Last May, I bought the HP LJ Pro 500 MFP 570n printer and since then I have PQ problem.  When printed, the documents are not as what is on the screen:  B&W pictures are green and white; colour pictures are bland and too dark. There is no problem

  • Ipad:  photo slide show with music problem.

    Using the ipad, looking at my photo's, I select a photo, select slide show and knowing that I have already set the play music with slide show, I then press the Airplay icon. Seconds later the slide show starts on the Apple TV, but there is no music.

  • Problem after installing OBI SE 1 to connect to dashboard. odbc

    Hi, After installing OBI SE 1 10.1.3.2.1 I try to open Oracle BI interactive dashboards (http://localhost:9704/analytics/saw.dll?Dashboard) I am not able to do this, because of the following message HTTP-Error:500: Internal server error. I found in C

  • How to use sbi debit card for itune purchase

    HOw to use sbi debit card for purchasing items from iTunes store?

  • Photoshop CS4 Consumes All My Memory

    I have 31 free gigabytes of space on my MacBook and no other applications open. When I open up a file file on Photoshop CS4 (81MB) my computer's memory drops from 31 gigs to less than 1 gig. When I try to move a layer in Photoshop, I get an error tha