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

Similar Messages

  • How can i display image in RTF template when Oracle Apps running in Windows

    Can any body help how can i display image in RTF template when oracle apps running in Windows Server.
    Thanks
    Ravi

    Hi Ravi,
    You can add images into your rtf template using MS Word Insert Picture feature.
    Did you try this method?
    Thanks
    Ravi
    [email protected]

  • Multiple images in rtf template with out using url conditions

    Just iam taken 3 logos from system to make copy and paste in rtf file
    But i need to write the conditions for those logos depend upon ord_id (or) supplier_name?
    How can i write condition by taking the if/when between logos
    Any one knows pls replay this (or) send to my mail id "[email protected]"
    Thanks and Regards,
    Basha

    Hi Tim,
    We have logged SR 5803815.992, and uploaded the RTF template and a sample XML data file.
    We are currently on 11.5.10 CU2 and 11i.XDO.H
    Please let us know if you need any other information.
    Thanks

  • Relative path for images in RTF templates

    Hi everybody!
    When I insert an image in a RTF template, I put its path into the web dialog, in order to see correctly the picture when I open the report from the xmlp server, in this way: url:{"http://servername/analytics/res/Images/image.bmp"}
    How can I make this path relative, in order to see the images even if the server name changes?
    Thanks so!
    Francesco

    Hi Tim,
    I am using BIP 10.1.3.3.2. I am able to access system variable CURRENT_SERVER URL.
    Steps:
    <?param@begin:CURRENT_SERVER_URL?>
    <xsl:value-of select="$ CURRENT_SERVER_URL"/>
    CURRENT_SERVER_URL is getting printed in BI Publisher. Value displayed is http://xx4697.xxx.co.in:9704/xmlpserver.
    Now we are importing xsl into RTF template. File aaa.xsl is stored at [BIP_Installation_Directory\oc4j_bi\j2ee\home\default-web-app]
    We have hardcoded the path for XSL in RTF. The path is <?import: http://xx4697.xxx.co.in:9704/aaa.xsl?>
    As we want to set dynamic path we changed hardcoded xsl path to <?import: {$CURRENT_SERVER_URL}/../aaa.xsl?> but it is not working. Sometimes BIP is taking local path of MyDocuments folder and sometimes Desktop path. If I put that XSL file in MyDocuments folder or Desktop, it is working fine. But ideally it should refer [BIP_Installation_Directory\oc4j_bi\j2ee\home\default-web-app] path...
    Thanks,
    Amit D

  • Images in RTF template giving errors

    Hi,
    I am using "XML Publisher Template Builder for Word" ver 5.6 Build 45.
    My requirement says that i need to put all data values in a Rectangular BOX. I made the template and tested the same by using Priview option of Template Buider, and it looks Good.
    Now as soon as i am trying to upload the same template it gives me NPE, i am pasting the same here....
    ## Detail 0 ##
    java.lang.NullPointerException
         at oracle.apps.xdo.XDOException.getMessage(XDOException.java:128)
         at java.lang.Throwable.getLocalizedMessage(Throwable.java:266)
         at java.lang.Throwable.toString(Throwable.java:343)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
         at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:862)
         at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:985)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:210)
    Now after this when i closed the instance and reopen it, i found the template is already added even after that exception.
    Now i when i am trying to run report it is compliting with error and in log life, error is shown as below...
    [9/21/06 2:45:46 PM] [UNEXPECTED] [186597:RT3517534] java.sql.SQLException: No c
    orresponding LOB data found :SELECT L.FILE_DATA FILE_DATA, DBMS_LOB.GETLENGTH(L.
    FILE_DATA) FILE_LENGTH, L.LANGUAGE LANGUAGE, L.TERRITORY TERRITORY, B.DEFAULT_LA
    NGUAGE DEFAULT_LANGUAGE, B.DEFAULT_TERRITORY DEFAULT_TERRITORY,B.TEMPLATE_TYPE_C
    ODE TEMPLATE_TYPE_CODE, B.USE_ALIAS_TABLE USE_ALIAS_TABLE, B.START_DATE START_DA
    TE, B.END_DATE END_DATE, B.TEMPLATE_STATUS TEMPLATE_STATUS, B.USE_ALIAS_TABLE US
    E_ALIAS_TABLE FROM XDO_LOBS L, XDO_TEMPLATES_B B WHERE L.LOB_TYPE = :1 AND L.APP
    LICATION_SHORT_NAME= :2 AND L.LOB_CODE = :3 AND L.APPLICATION_SHORT_NAME = B.APP
    LICATION_SHORT_NAME AND L.LOB_CODE = B.TEMPLATE_CODE AND ( (L.LANGUAGE = :4 AND
    L.TERRITORY = :5 ) OR (L.LANGUAGE = :6 AND L.TERRITORY = :7) OR (L.LANGUAGE=
    B.DEFAULT_LANGUAGE AND L.TERRITORY= B.DEFAULT_TERRITORY ) )
    As there is no row returing in this query i thing there are some prasing issues with RTF templated with images as the same report works fine without images.
    Please tell me if you have any pointer how to resove the issue.

    Hi Tim,
    We have logged SR 5803815.992, and uploaded the RTF template and a sample XML data file.
    We are currently on 11.5.10 CU2 and 11i.XDO.H
    Please let us know if you need any other information.
    Thanks

  • Can I insert comments into RTF Templates?

    I'm using Oracle XML Publisher Template Builder for Word, Version 5.6 Build 45.
    The RTF template I'm working on has grown to be quite complex, and I would like to include some documentation on the template, so that other people who might pick up the work after me know what was happening.
    Is there any way to insert comments into the template, in the same way as is possible for e.g. in SQL? I tried to insert a Word Comment, but that generates errors.
    I suppose the alternative is to document logic decisions etc. in a separate document.
    Thanks

    Hi,
    You can use the following xsl tag
    <xsl:comment>This is a comment!</xsl:comment>
    Sandesh

  • Shared Folder Images in RTF Template?

    Hi, how to use images which are in shared folders like *\\\\path\\Trademarks\\test.jpg* into RTF templates? url:{} works only for http links and doesn't work for shared path. I need to have dynamic images, we have a logic in query that would give us the path like *\\\\usnbkb110p\\Trademarks\\testforuljp.jpg*. Not sure how to proceed further. Kindly advice.

    Any ideas on this? Any recommendation would be appreciated.

  • How to display a blob image in RTF template's Header.

    Hi,
    I want to display a blob image (logo company) in my RTF template,
    my problem is how i can display this image in the template's Header.
    I tried this
    <?
    <fo:instream-foreign-object content-type="image/jpeg" >
    <xsl:value-of select=".//LOGO"/>
    </fo:instream-foreign-object>
    ?>
    but was unsuccessful
    Thanks in advance.

    I tried this
    <?
    <fo:instream-foreign-object content-type="image/jpeg" >
    <xsl:value-of select=".//LOGO"/>
    </fo:instream-foreign-object>
    ?>
    but was unsuccessful
    sure
    what is red elements ?
    you template can be looks like
    ..... some data .....
    ( after  all data )
    <?template:footer_logo?>
    <fo:instream-foreign-object content-type="image/jpeg" ><xsl:value-of select=".//LOGO"/></fo:instream-foreign-object> (as field )
    <?end template?>
    <?call-template:footer_logo?> ( in header/footer )
    some remarks https://oralublog.wordpress.com/2014/10/04/bi-publisher-11g-footers-and-headers-in-rtf-template/

  • Inserting image in rtf doc

    Hi all,
    i am trying to make my own rtf editor , I've read the most of the toppics in this forum on this issue,
    but I'm stucked on inserting the hex Data into the document.
    Do I actually need to override ImageView?
    I found a method in RTFReader (instantiated from read(InputStream in,...)) handleBinaryBlob(byte[] data).
    RTFReader is private, so I cannot override this method. Should I override the read method in
    RTFEditorKit and then call the read method in DefaultEditorKit, or I could just use the doc.insertString(...) with the binary data inside of the overriden RTFEditorKit read method? I will lose the functionallity of the RTFParser this way.
    I know I should override read and write methods but how?
    So could somebody help me on this?
    The code for creating the binary data from buffered image and creating the Icon from StanislavL follows:
    ImageIcon icon=(ImageIcon)StyleConstants.getIcon(attr);
    if (icon!=null) {
    int w=StyleConstants.getIcon(attr).getIconWidth();
    int h=StyleConstants.getIcon(attr).getIconHeight();
    ByteArrayOutputStream os=new ByteArrayOutputStream();
    PNGCodec p=new PNGCodec();
    ImageEncoder pe=p.createImageEncoder("PNG",os,null);
    BufferedImage bi=new BufferedImage(w,h,BufferedImage.TYPE_INT_RGB);
    bi.getGraphics().drawImage(icon.getImage(),0,0,null);
    pe.encode(bi);
    byte[] ba=os.toByteArray();
    int len=ba.length,i;
    StringBuffer sb=new StringBuffer(len*2);
    for (i=0;i<len;i++) {
    String sByte=Integer.toHexString((int)ba & 0xFF);
    if (sByte.length()<2)
    sb.append('0'+sByte);
    else
    sb.append(sByte);
    String s=sb.toString();
    out.write("{\\pict\\pngblip ");
    out.write(s);
    out.write("}");
    extracting image
    String content; //<- image representation
    int len=content.length();
    //converts to binary representation
    byte[] buf=new byte[len/2];
    for (int j=0; j<len/2 ;j++) {
    String c1=content.substring(j*2,j*2+1);
    String c2=content.substring(j*2+1,j*2+2);
    byte b1=Byte.parseByte(c1,16);
    byte b2=Byte.parseByte(c2,16);
    buf[j]=(byte)(b1*16+b2);
    //creates image from binary
    Image img = Toolkit.getDefaultToolkit().createImage(buf);
    ImageIcon icon=new ImageIcon();
    icon.setImage(img);
    if ((icon.getIconHeight()<0) || (icon.getIconWidth()<0))
    return;
    MutableAttributeSet attr=new SimpleAttributeSet();
    StyleConstants.setIcon(attr,icon);
    //inserts image in the document
    document.insertString(currentOffset," ",attr);
    currentOffset++;
    I guess these two functions must be implied into the overriden EditKit write and read methods.
    Could somebody give me a start idea?
    regards
    rumpi

    Thanks for reply.
    It did't helped me a lot or I'dont really understand your idea.
    What you say in your postings is build my own reader and writer.
    For example to open a rtf file in my jeditorpane I must read from
    the input stream each byte and reimplementing AbstractFilter, RTFParser and RTFReader
    I could get all headers like \par or \pic and then rtfDoc.insertString(pos, "the label content", attr) with the attributes extracted from header.
    When that is the only way I am asking myself what are the swing people for?!?!
    I'll try to do that myself, so I'm not asking for code but I would appreciate
    some detailed info about it. For example when I dont use RTFReader anymore
    I loose everything what I've got untill now. So I should read every byte opening a file
    and check like in RTFParser if the first character is "\", then the next couple of bytes
    untill I get the header. Then I should check which labels(text) is this header for(until the next header), so
    I could insert a string with the according attribute set? For Icon when I get the
    \pic header I read the byte sequence and build the picture just like you wrote.
    My Editor is an applet so I've hoped I wouldn't send too much code to the client
    so reimplementing RTFParser, Reader... would slow it down, but whatever.
    Thats really a lot of work only because the given classes are not extendable, grrrr.
    Viravan, thanks for the fast reply , but like I said , I 've already read all relevant
    postings in this forum and didnt found something really helpful. I already read all
    tutorials and articles from sun about this issue and I still have the feeling I'm a freshman
    in this area.
    I'm still angry with the swing team about it, this bug is noted since 2001 I think. grrr
    regards
    rumpi

  • RTF Template Condition

    Hi,
    Can anybody tell me how to add a condition in rtf template.
    Requirement: if sum =0
    Need to get data in one section
    if sum!=0
    Need to get data in another section
    Thanks!!!!

    >
    I would like not to hardcode the name of the Top XML node (Invoice) as it may change in the future.
    >
    IMHO name of this tag is needed
    <?if://ShipAddress?>cheking for existing tag ShipAddress on any level of xml
    it's true for ShipAddress for Invoice and for Invoice/Order
    <?if://Order/ShipAddress?>cheking for existing tag ShipAddress after tag Order
    so need point for start
    >
    n XSL/XPATH doc, they mention that we can use the dot (./ShipAddress)
    >
    yes but look at *.* more closly
    <?for-each:Invoice?>
    <?if:./ShipAddress?>
    or
    <?if:./Order/ShipAddress?>

  • Display of image in rtf template

    Hi,
    I have a tag in my xml file like
    <ImageDistributeur>IMAGE:D:\EXPLOIT_UNPMF\Edition\Image\L29004G.tif</ImageDistributeur>
    and the image is stored in the particular location specified inside the tag.
    The xml file doesnt contain the image...
    My question is how can i use the tag and get the image in the template.
    I dont want to embed the image directly into the template as it is a dynamic logo...
    so i have to use the xml tag.
    but if use the above <ImageDistributeur> tag... its obvious that the text inside the tag only will be printed...
    Is there any other way to get the image from the path specified ..if so please guide me in this issue.

    Hi,
    have a look at Tims Blog: http://blogs.oracle.com/xmlpublisher/2006/05/02#a25
    Regards
    Rainer

  • "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

  • Images Behind Text in RTF Template

    While creating a few rtf templates, I noticed that if an image is to be shown behind text then the image will not render to back to .rtf by bi pub.
    If I put the image inline with text, it renders just fine.
    Am I missing a step that would allow me to render the image behind text or is it just working as intended?
    Oracle BI Publisher 10.1.3.4.1
    Thank you.
    Edited by: Crawler409 on Dec 17, 2010 2:49 PM
    Edited by: Crawler409 on Dec 17, 2010 2:50 PM

    Hi
    Can you pl. send me the RTF template and sample XML. I will try to fix the template.
    Thx
    chundi ([email protected])

  • Using OR condition in RTF Template

    Hi,
    How to use OR condition in RTF?
    say for example,consider the EMP table.
    I want to show the employees of department 10 and 20 in my XML Publisher report.
    How can i write --
    if deptno = 10 or deptno =20 in RTF template

    you can add the condition in RTF template
    <?if:XMLfield=30 or XMLfield=10 ?> to display <?end if?>

  • IF conditions stopped working in RTF Template

    Hi,
    After applying Financials Family Pack G and Running 'XML Publisher Re-Generate template' program. If conditions with xdoxslt:get_variable on RTF template stopped working.
    Oracle Apps version: 11.5.10.2
    XML Publisher version: 5.0.0
    Any help or directions would be greatly appreciated.
    Thanks,
    Anil

    Hi,
    First thing I would suggest would be to patch XMLP to 5.6.3.
    This is a far more stable release than 5.0.0.
    Hopefully this should resolve your issues.
    Regards,
    Cj

Maybe you are looking for

  • How to fix the size of a multiple panels in jFrame

    Hi, In Jframe I added one rootPanel Inside rootPanel, I added two more panels 1. userInputPanel which intern contains one textField & one jLabel 2. buttonPanel which intern consists of two buttons So I need to view, always userInputPanel top side and

  • GL Translation at Transaction Level?

    We are mutli-national company with 22 Sets of Books and 21 different functional currencies running on 11i (11.5.10.2) We consolidate all into single SOB at end of each month into USD. Issue is we are getting a lot of questions from our upper level ma

  • There is no edit function for profile picture change

    Hi!! I go a problem changing my profile picture as there isn't any edit function therefore I have been stuck with the same picture from the last unknow period!!!!  Normally there is edit function though; but the same button seems vanished!!  Could an

  • My iPhone Wont Ativate

    I Have a iPhone 4s 16GB ATT And The  ESN is not Blacklisted  Wen I Try to Activate With a ATT Chip its Say me:"This iPhone is not able to complete the activation process and needs to be replaced. Please visit your nearest Apple Store or Authorized se

  • CIF Post Processing

    Dear All, In the CIF post processing, either via CIF Cockpit or via other post processing transactions, in APO or ECC, we need to go into each post processing record to find the reason for the post processing record being created and to check the sta