Use of xdofx:Instr function in a RTF template

I'm trying to use the xdofx:Instr function within a RTF template but am running into problems because the code produces an error. The following code worked before the data changed:
<?if:number(DS_SEQ)=1 and( M_TRANTYPE='F')?>
Now my M_TRANTYPE comes back as 'F,H' so I thought I would use the xdofx:Instr function. I redid the RTF code to read:
<?if:number(DS_SEQ)=1 and( xdofx:Instr(M_TRANTYPE,'F',1)>0 )?>
but this fails. I've tried other combinations but they also fail:
<?if:xdofx:Instr(M_TRANTYPE,'F',1)>0 ?>
<?if: xdofx:Instr('abc','a',2) >0?>
Can the xdofx:Instr be used in an "if" construct or am I missing something about its proper use?
Alex.

Alex,
Instr appears to be fine... check the xdofx syntax.
i.e.
<?xdofx: if Instr(M_TRANTYPE,'F',1)>0 then DISPLAY_XXX end if?>
regards,
Rownald

Similar Messages

  • Issue with ROUND function in RTF template

    Hi All,
    Can anyone please help me in implementing the ROUND function at the RTF template.
    Need to handle rounding of amounts at the RTF template level itself.
    The ROUND function should be implemented to the following tags:
    <?sum(current-group()/TAXABLE_AMOUNT)?> (Record level)
    <?sum(TAXABLE_AMOUNT)?> (Report level total)
    Eg. If the Sum(current-group()/TAXABLE_AMOUNT) for a particular record is 401.65 then it should round of to 402
    we try to do this using following syntax ..
    1) by declaring variable "value"
    <?xdoxslt:set_variable($_XDOCTX, value, sum(current-group()/TAXABLE_AMOUNT))?>
    2) <?xdofx:round(sum(current-group()/TAXABLE_AMOUNT))?>
    3)<?xdofx:round(xdoxslt:sum(current-group()/TAXABLE_AMOUNT))?>
    but we ding get the solution.
    A quick response on this is highly appreciable.
    Thanks,
    Praveen

    Re: Summing derived values within xdofx:
    Re: Rounding not working

  • Multiple PS Query Data Sources in RTF Template

    Is it possible to use two PS Queries as Data Sources on an RTF template in XML Publisher?
    There is a field in the main Data Source (PS Query) that needs to join to some other tables. This slows down the query considerably even after tweaking the join and tuning, etc. Instead of doing the join in the main PS Query Data Source, can we do any of these?
    1. Do a select statement inside an RTF template Form Field?
    2. Use two PS Queries on the same RTF template?
    3. Import a sub template that uses its own PS Query Data Source for the field?
    Hope this makes sense. Thank you.

    You can have multiple data models and then use the 'concatenated SQL data source' to generate a single xml file that includes data based on both queries. You can not do a select statement inside a RTF template.
    Within the RTF template you can write logic to join the two data sets... see this blog post:http://blogs.oracle.com/xmlpublisher/entry/formatting_concatenated_dataso
    Thanks,
    Bipuser

  • Xdo loader is not replacing the RTF template

    Hi ,
    I am using the below syntax to upload the RTF template. It has to replace the existing template. But it is not doing.
    java oracle.apps.xdo.oa.util.XDOLoader UPLOAD -DB_USERNAME apps -DB_PASSWORD $apps_pw -JDBC_CONNECTION $p_host:$p_port:$p_instance -LOB_TYPE TEMPLATE_SOURCE -APPS_SHORT_NAME XXNIN -LOB_CODE XXNINOMPRICELISTAUDIT -LANGUAGE en -TERRITORY US -XDO_FILE_TYPE RTF -FILE_CONTENT_TYPE 'application/rtf' -FILE_NAME $XXNIN_TOP/patch/115/import/US/R_4057_PRICE_LIST_AUDIT.rtf -CUSTOM_MODE=FORCE
    Regards
    Lokesh

    i used
    java oracle.apps.xdo.oa.util.XDOLoader UPLOAD -DB_USERNAME apps -DB_PASSWORD $apps_pw -JDBC_CONNECTION $p_host:$p_port:$p_instance -LOB_TYPE TEMPLATE -APPS_SHORT_NAME XXNIN -LOB_CODE XXNINOMPRICELISTAUDIT -LANGUAGE en -TERRITORY US -XDO_FILE_TYPE RTF -FILE_NAME $XXNIN_TOP/patch/115/import/US/R_4057_PRICE_LIST_AUDIT.rtf -OWNER APPS -CUSTOM_MODE FORCEfor your sample data
    for more info plz see
    How To Use XDOLoader to Manage, Download and Upload Files? [ID 469585.1]

  • Using multiple xdofx commands together. For eg: substr and instr

    Hi,
    I am working in developing an RTF where a situation is to use xdofx:sustr and xdofx:instr together.
    I tried but its not working properly.
    Is there any special commands to use in such a scenario.
    Thanks,
    Anand

    plz post what are you doing
    works for me
    as example
    <?xdofx:substr(substr(COLOR,5),instr(substr(COLOR,5),’;’)+1)?>for
    <ROWSET>
    <ROW>
    <COLOR>qwe qwe;rty</COLOR>
    </ROW>
    </ROWSET>gives
    rty

  • Error while using CURRENTMEMBER property in INSTR function

    Hi,
    I am looking for SQL 'LIKE' operator equivalent solution in MDX and I tried the below query.
    SELECT FILTER([Company].Members, INSTR([Company].CURRENTMEMBER.NAME,"AA") >0) on columns from temp1.db
    The above query is not compiling due to CURRENTMEMBER propery in INSTR function.
    When I replaced [Company].CURRENTMEMBER.NAME with a constant "AABB", then the query is working fine.
    SELECT FILTER([Company].Members, INSTR("AABB","AA") >=0) on columns from temp1.db
    Also, CURRENTMEMBER is working fine outside INSTR function.
    SELECT FILTER([Company].Members, [Company].CURRENTMEMBER.[GEN_NUMBER] = 1) DIMENSION PROPERTIES GEN_NUMBER on columns from temp1.db
    Is CURRENTMEMBER property not supported in INSTR? I am using Hyperion Provider Services 9.3.1.
    Is there any other solution for SQL 'LIKE' operator equivalent in MDX?
    Thanks in advance,
    Anil.

    With Essbase 9.3.1 it ought to work. The following is a simple query that works for me:
    select
      filter (
           [Market].Members,
           Instr (1,
                [Market].CurrentMember.MEMBER_NAME,
                "e"
           ) > 0
      ) on axis(0)
      from [Sample.Basic]
      ;

  • How to use instr functions?

    Hi guys,
    I have a table like this:
    name data
    a 10101000U000
    b 011U11001100
    c 0U1001001001
    d 01U010100010
    I want to get the position of "U" in data column, like:
    name position of U
    a 9
    b 4
    c 2
    d 3
    what should I do? I use "instr" function, but failed. can anyone help me on this?
    Thanks.

    Example for you:
    [email protected]> select instr('10101000U000','U') from dual;
    INSTR('10101000U000','U')
    9
    [email protected]> select instr('011U11001100','U') from dual;
    INSTR('011U11001100','U')
    4
    Best Regards
    Krystian Zieja / mob

  • Set variable to result of instr function

    I am trying to set a variable to the result of the instr function. I am getting the error Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'xdofx' used but not declared.
    My code is as is below <?xdoxslt:set_variable($_XDOCTX,’POS1’, xdofx:Instr (LINE_ITEM_DESCRIPTION,'|',1,1))?>
    I know in the documentation it says "You cannot mix xdofx statements with XSL expressions in the same context" is this such a case? If so how do I go about getting the result of Isntr into a variable?
    Thanks a ton

    Try using the below code
    <?xdoxslt:set_variable($_XDOCTX,’POS1’, xdoxslt:instr(LINE_ITEM_DESCRIPTION,'|',1,1))?>

  • SUM Function in RTF Template

    Hi buddies,
    can we use functions like SUM,AVG etc. in the RTF Template.
    If possible please give adivce for the below scenario
    I have one column in the main body table "Extended Amount", I want to sum this field for the another column Total Extended Amount below this Main table.
    with regards
    Ram

    Hi All,
    I have a problem in calculating the SUM in RTF template with condition,
    Here is the XML
    - <LIST_G_LINE_NOTES>
    - <G_LINE_NOTES>
    <LINE_TRX_ID>1567856</LINE_TRX_ID>
    <LINE_ID />
    - <LIST_G_TRX_LINE>
    - <G_TRX_LINE>
    <CF_ITEM_NO>SDCN1144B</CF_ITEM_NO>
    </G_TRX_LINE>
    </LIST_G_TRX_LINE>
    - <LIST_G_LINE_EQUIVALENT_UNIT_PRICE>
    - <G_LINE_EQUIVALENT_UNIT_PRICE>
    <LINE_EQUIVALENT_UNIT_PRICE>-15.99</LINE_EQUIVALENT_UNIT_PRICE>
    <LINE_EXCHANGE_EXTENDED_AMOUNT>-223.86</LINE_EXCHANGE_EXTENDED_AMOUNT>
    <CUSTOMER_TRX_LINE_ID>1567856</CUSTOMER_TRX_LINE_ID>
    </G_LINE_EQUIVALENT_UNIT_PRICE>
    </LIST_G_LINE_EQUIVALENT_UNIT_PRICE>
    - <LIST_G_TRX_LINE>
    - <G_TRX_LINE>
    <CF_ITEM_NO></CF_ITEM_NO>
    </G_TRX_LINE>
    </LIST_G_TRX_LINE>
    I need the summation of field LINE_EXCHANGE_EXTENDED_AMOUNT with the condition CF_ITEM_NO!=''
    can anybody help me with the solution.
    Thanks in Advance

  • How to use XDOXSLT in rtf template layout for etext template creation

    <DEFINE CONCATENATION>     BookDetails
    <BASE LEVEL>     Category
    <ELEMENT> Name || '/' || Price     
    <DELIMITER>      '/'
    <END DEFINE CONCATENATION>     BookDetails
    With EFTProcessor the above details are created in xsl file as follows
    <xsl:template name="CONCAT_BookDetails">
    *I need to declare one more variable here
    EG: <xsl:value-of select="xdoxslt:set_variable($mycount, count(.//Category))"/>
    --and use this variable for any dyanamic process inside this template. How to achieve this in rtf template by declaring a xdoxslt function. How to declare this
    syntax in rtf layout so that it creates a varibale in xsl template using the EFTProcessor. Please help me out. The main point here is to include xslt functions in
    rtf template layout for etext template creation.*
    <xsl:for-each select=".//Category">
    <xsl:call-template name="CONCAT_BookDetails_V"/>
    </xsl:for-each>
    </xsl:template>

    in the next time use BI Publisher forum - BI Publisher
    <?format-number(ENTERED_CR,'##,##0.00')?>it's works for me
    output:
    444    ->  444.00
    444.55 ->  444.55

  • Problem with extended SQL functions in RTF Template

    Hello,
    I'm new to BI Publisher and I'm trying to create a new rtf template. I've created my layout and added fields without any problems, but I'm having trouble trying to insert calculations such as add,substract,multiply,divide, etc.
    Here is an example of what I'm trying to do:
    <?xdofx:STAFF_ASMT+100?>
    Where STAFF_ASMT is one of my fields. When I add this function all I get is the actual value from that field returned on the first page, and then on other pages I get the value plus an extra zero.
    So with my example data below I get: 6600 on page 1 and 51830 on page 2. Any ideas on what I'm doing wrong or if it is possible to do what I'm doing? Also, is it possible to add/substract/multiple two or more fields together?
    Something like this: <?xdofx:STAFF_ASMT+GROSS_INV?>
    I was going to add all of these functions to my SQL statement, but I have 30 or so calculations I want to perform in the layout and I don't want to have to write that all out in SQL.
    <ROWSET>
    <ROW>
    <STAFF_ASMT>6600</STAFF_ASMT>
    <GROSS_INV>0</GROSS_INV>
    </ROW>
    <ROW>
    <STAFF_ASMT>5183</STAFF_ASMT>
    <GROSS_INV>0</GROSS_INV>
    </ROW>
    </ROWSET>
    Thanks for your help

    When I tried that I get the following error message when I click the Validate Template option:
    [080609_031631893][][ERROR] [Line 162.184] Incorrect XPath: +
    And when I try to generate a PDF preview I get:
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeNewXSLStylesheet(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
         at RTF2PDF.runRTFto(RTF2PDF.java:629)
         at RTF2PDF.runXDO(RTF2PDF.java:439)
         at RTF2PDF.main(RTF2PDF.java:289)
    Caused by: oracle.xdo.parser.v2.XPathException: Error in expression: './/+'.
         at oracle.xdo.parser.v2.XSLProcessor.reportException(XSLProcessor.java:806)
         at oracle.xdo.parser.v2.XSLProcessor.newXSLStylesheet(XSLProcessor.java:571)

  • How Can I apply a RTF Function on a variable in RTF Template in XML Publisher Report

    Hi Everyone,
    I am developing a RTF Template of XML Publisher Report, I have a variable lv_counter which I can declare using below syntax
    <?xdoxslt: set_variable($_XDOCTX, 'lv_counter',0)?>
    I can access this variable in the template as <?xdoxslt: get_variable($_XDOCTX,'lv_counter')?>
    My need is to print the variable in words in the RTF Template. I am using <?xdofx: to_check_number(xdoxslt: get_variable($_XDOCTX,'lv_counter'))?>
    But this is not working. any help will be appreciated thanks in advance
    The XML Publisher Desktop version which I am using is 10.1.3.3.0
    Please let me know where I can post this question, if this is not the appropriate discussion forum.
    Thanks in Advance.

    Hi,
    Can you elaborate your requirement little bit clear with some example like what is your expected output.
    And you can post you BI related question in the BI publisher forum
    https://forums.oracle.com/community/developer/english/business_intelligence/business_intelligence_foundation/bi_publisher/content?filterID=contentstatus[published]~objecttype~objecttype[thread]
    Regards
    Sri

  • How to use Table valued MSSQL  function in OBIEE

    Hi all,
    Can some one help me to understand how to use table valued function in OBIEE? I want to use a table valued function (MSSQL function, with some input parameter), in the physical layer to pull the data?
    I know for MSSQL Stored Procedure we can write as
    EXEC SP_NAME @Parameter = 'VLUEOF(NQ_SESSION.Variablename)'
    but now I have a table valued function in the query window I can get the data as
    select * from myfunction(parametervalue)
    In physical layer of OBIEE I have tried as
    select * from myfunction('VLUEOF(NQ_SESSION.Variablename)'), but I'm getting error as the NQ_SESSION variable doesn't have a value , but actually I have initialized the variable but still Im getting error.
    Can some one help me to solve this.
    Thanks,
    Mithun

    Follow this link and try yourself. let me know for issues
    Substring instr issue in obiee
    Appreciate if you mark
    Edited by: Srini VEERAVALLI on Feb 20, 2013 8:13 AM

  • Not able to use @section and Sort within a group in RTF Template

    When i try to use sort with for-each-group@section in my template, the Output Post processor is throwing the following exception
    Caused by: oracle.xdo.parser.v2.XSLException: <Line 31, Column 84>: XML-22047: (Error) Invalid instantiation of 'xsl:sort' in 'fo:flow' context.
    My tags in the RTF template are as below:
    <?for-each-group@section:G_PERSON_ID;./DEPT?><?sort:DEPT;'ascending';data-type='text'?>
    -- there are 2 more groups within this.
    <?end for-each-group?>
    I don't get the error if i remove @section from the above tag in my RTF template.
    OR
    IF i remove the sort tag and keep the @section , it still works.
    I need the "sort" so that i can sort the output by department number and I need the "section" so that i can acheieve context based header title for the page using the tag given below in the header area of the word RTF doc. The DEPT number should change as per the data shown in the report.
    DEPT <?DEPT?> CLASSIFICATION SENIORITY LISTING BY CLASS CODE & DATE
    I am stuck with either being able to use the Sort or the Header feature but not both.
    I guess that section is needed for the context based header title to work, because all the data shown in the current page should correspond to only one single DEPT value (to make the Header title consistent with the data). But i dont get why i am not able to sort. The exception from OPP simply beats me. Please help!!
    I am using the XML Pub Desktop 5.6.2 to develop my templates.
    Is there any way to acheive this? Can someone throw some light on this.
    Thanks in advance.

    Help About says I'm on 20.0.1
    Up until last week, I was able to use the tab key when typing emails and other multi-line text boxes.
    Suddenly the behavior of the tab key changed. This isn't the first time. It's been quite a while ago that the function of the tab key changed from indenting to moving around the page, then after some time it changed back to indenting.
    Can we get this fixed and leave it alone, please?
    I may give one of those add-ins a try, but my problem with add-ins is that they break when FF is patched or upgraded, then I'm left with out the solution they provide.
    Can we just fix Firefox, please?
    Thanks,
    Frank
    P.S. Another potential fix I came across suggested starting FF in safe mode to see if the problem goes away. It does not. It seems to be a change to FF that appeared after an update last week. On or just befor 24 Apr.

  • Dynamic PL/SQL & substr, instr function

    I am having trouble with incorporating the SUBSTR and INSTR functions into my dynamic PL/SQL procedure using Oracle 8i.
    I have data that is packed into one column seperated by a delimiter (':')
    I need to seperate the data to use indicidual pieces.
    If I run my query in general -
    select substr(secondcol, 1, instr(secondcol, ':',1,1)-1) ONE,
    substr(secondcol,instr(secondcol, ':',1,1)+1,instr(secondcol, ':',1,1)-1) TWO,
    substr(secondcol,instr(secondcol, ':',1,2)+1,instr(secondcol, ':',1,1)-1) THREE,
    substr(secondcol,instr(secondcol, ':',1,3)+1,instr(secondcol, ':',1,1)-1) FOUR
    from temp_table where firstcol=100
    This works and gives me the right result.
    e.g
    DATA :
    Firstcol SECONDCOL
    100 1:2:3:4
    Result:
    ONE TWO THREE FOUR
    1 2 3 4
    However to make this generic if I use it in a function passing it a parameter which has ':' delimited data it does not work and gives me errors. All I want is to get the output as a string that looks like my query above so I can use it in my proc.
    create or replace function MYJUNK(TFieldNew IN CHAR)
    RETURN CHAR IS
    UpdateString Varchar2(100);
    BEGIN
    UpdateString := 'First=substr('||TFieldNew||', 1, instr('||TFieldNew||', '':'',1,1)-1) ONE, ';
    UpdateString := UpdateString || ' Second=substr('||TFieldNew||', instr('||TFieldNew||', '':'',1,2)+1, instr('||TFieldNew||', '':'',1,1)-1) TWO, ';
    UpdateString := UpdateString || ' third=substr('||TFieldNew||', instr('||TFieldNew||', '':'',1,3)+1, instr('||TFieldNew||', '':'',1,1)-1) THREE from temp_table';
    return UpdateString;
    END;
    The function compiles but gives me run time errors
    This is what I get -
    SQL> select myjunk('''1:2:3:4''') from dual;
    select myjunk('''1:2:3:4''') from dual
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SGHDTA.MYJUNK", line 8
    ORA-06512: at line 1

    You are getting an error because updatestring is longer than the 100 characters you defined it as. Try using VARCHAR2(4000). Also, if you are trying to generate the sql statement, you need to get rid of first=, second= and third= when you build the string.
    This is what your function returns. I put in line breaks for clarity:
    First=substr('1:2:3:4', 1, instr('1:2:3:4', ':',1,1)-1) ONE,
    Second=substr('1:2:3:4', instr('1:2:3:4', ':',1,2)+1, instr('1:2:3:4',':',1,1)-1) TWO, 
    third=substr('1:2:3:4', instr('1:2:3:4', ':',1,3)+1,instr('1:2:3:4', ':',1,1)-1) THREE
    from temp_tableIf you are trying to actually parse the column, then you need something more like:
    create or replace procedure MYJUNK(TFieldNew IN VARCHAR2,out1 OUT VARCHAR2,
                                       out2 OUT VARCHAR2, out3 OUT VARCHAR2) is
    BEGIN
       out1 := SUBSTR(TFieldNew,1, INSTR(TFieldNew,':',1,1)-1);
       out2 := SUBSTR(TFieldNew, INSTR(TFieldNew,':',1,2)+1, INSTR(TFieldNew,':',1,1)-1);
       out3 := SUBSTR(, INSTR(TFieldNew,':',1,3)+1, INSTR(TFieldNew,':',1,1)-1);
    END;

Maybe you are looking for