Method to Format a string column containing HTML tags as simple string.

Hello,
I am working with formating a string column which holds Html tags.
I want to remove these tags from the actual data which has to be shown on the BI Publisher report.
Can you suggest how can we format this in the DataSet designer of BI publisher so that my data is recognised on the Layout designer.
I have been trying to create an expression using the "Add Element by Expression" option to format this html tag data as normal string without the tags.
Can you suggest if this is the correct method to do this.
I found this below code being used in an existing DateSet but i am not able to recreate a similar formating on this kind of data column.
<![CDATA' || '['|| TO_CLOB(SUCCESS_CRITERIA) || ']' || ']>
Kindly suggest if you have any idea on the above mentioned issue.
Thanks,
Shweta

And read this:
Navigate yourself around pitfalls related to the Runtime.exec() method
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

Similar Messages

  • Contains HTML tags & print

    Hi,
    Reports6i patch10
    Scenario is: I have a column (database colummn text with embedded HTML ) where I set property 'Contains HTML tags'
    I get the column incl html rendered find where desformat=html&destype=file&desname=myfile.html '
    but when setting
    destype=printer&desformat=html&desname=myqueue and sending output straight to printerqueue the html is not being rendered in fact the column is not rendered at all
    HAs anyone similar experience ? solutions ?
    TIA
    Per

    Hello Per Elmgreen,
    When DESTYPE is specified as PRINTER, Reports formats output in PS or PCL format (depending on the printer language understood by the destination printer). Since these formats do not understand HTML tags, any such markup in the output will remain unformatted.
    In order to get properly formatted output using HTML tags, you could generate the report to a HTML file (with the 'Contains HTML tags' property set) and then print the file using a browser.
    Thanks,
    The Oracle Reports Team.

  • Integrate html tags in a string and display it in a multiline text area

    Hi ABAPers!!
    First of all let me tell you that I'm working in ACCENTURE Casablanca(Morocco) and this is my first Job in my career.
    I'm working on an ALV OO, the program consists on creating an ALV using OO, In my selection screen there's a parameter of type ddobjname I provide the name of table and it returns the table's fields in another dynpro (screen0100), To do this I used the FM: 'DDIF_FIELDINFO_GET' then I append the internal table returned in another one to add the field CB (CheckBox), and I add a button in the toolbar, the function of this button is to generate a MySQL script To create the table provided by the user in my parameter (Screen 1000), but the fields of this table(MySQL) in the generated script are only the selected ones by cheking the checkbox in the ALV.
    I store my script in a string.
    My problem is that I want to show my script in a text area, but I don't know how to create a multiline text area!!
    And I want to use HTML tags in my string.
    I don't want to my string like this :
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI ( CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY , FLTIME INT ( 10 ) , DEPTIME DATETIME ( 6 ) , DISTANCE DOUBLE ( 9 ) , FLTYPE VARCHAR ( 1 ));
    But I want it to be shown like  this:
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI (
    CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY ,
    FLTIME INT ( 10 ) ,
    DEPTIME DATETIME ( 6 ) ,
    DISTANCE DOUBLE ( 9 ) ,
    FLTYPE VARCHAR ( 1 ));
    Thanks in advance
    Regards
    SMAALI Achraf
    Edited by: SMAALI90 on May 11, 2011 7:12 PM

    Hi again!!
    You know what!! let's forget the HTML and focuse on what I want to show.
    As I told you, I've a string which contains my script.
    I don't want that it will be shown as a simple line like this :
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI ( CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY , FLTIME INT ( 10 ) , DEPTIME DATETIME ( 6 ) , DISTANCE DOUBLE ( 9 ) , FLTYPE VARCHAR ( 1 ));
    But I want it to be shown as follows:
    CREATE [TEMPORARY] TABLE [IF NOT EXISTS] SPFLI (
    CONNID CHAR ( 4 ) NOT NULL PRIMARY KEY ,
    FLTIME INT ( 10 ) ,
    DEPTIME DATETIME ( 6 ) ,
    DISTANCE DOUBLE ( 9 ) ,
    FLTYPE VARCHAR ( 1 ));
    and finally I want to show it in a multiline text area.
    Plz what shud I do?!!! If possible I need a piece of code.
    PS : I create a HTML Viewer using this code :
    DATA : go_conteneur          TYPE REF TO cl_gui_docking_container,
                 go_controle_html    TYPE REF TO cl_gui_html_viewer.                 
      CREATE OBJECT go_conteneur                     
        EXPORTING                                    
          repid     = sy-repid                       
          dynnr     = '0100'                         
          side      = go_conteneur->dock_at_bottom   
          extension = 1000                           
          name      = 'CONTENEUR'                    
        EXCEPTIONS                                   
          OTHERS    = 1.                             
      CREATE OBJECT go_controle_html                 
        EXPORTING                                    
          parent = go_conteneur                      
        EXCEPTIONS                                   
          OTHERS = 1.
    But when it's shown my ALV disappears!!!

  • Smartform with text containing html tags

    I am reading from a table that contains html tags like
    <br>
    <menu>
    <LI type="disc">This is a line which contains html tags
    that goes over to 2nd line
    <LI type="disc"> This is also another line which contains html
    tags.
    and each line is stored in a different row. The customer has agreed to use only 3 of the above html tags (
    <br>, <menu> and <LI type="disc">
    When the output is previewed in smartforms, the html tags needs to be formatted and not print in raw format as follows: 
    <LI type="disc">This is a line which contains html tags
       that goes over to 2nd line
    <LI type="disc"> This is also another line which contains html
       tags.
    How can this be done ?

    ok understood...
    you can try this
    Loop at i_html into wa_html.
    tmp = strlen( wa_html-line).
    do tmp times.
    if wa_html-line+0(1) = <
    l_start = 1.
    __elseif wa_html-line+0(1) = >
    l_start = 0.
    concatenate l_char wa_html-line+0(1) into l_char.
    endif.
    if l_start = 1.
    concatenate l_char wa_html-line+0(1) into l_char.
    wa_html-line = wa_html-line+1(l_tmp - sy-index) OR use the keyword SHIFT LEFT...plz chk the syntax
    elseif l_start = 0 and l_char = <LItype=disc>
    concatenate <BULLET>  wa_html-line into  wa_html-line separated by space.
    endif.
    enddo.
    modify i_html form wa_html.
    endloop.
    now u define two text element one with bullet and another without bullet. this is how u insert bullet:
    goto to the texteditor of a text element in smartform. Its a small button on the left hand side of.
    Then goto insert>characters>sap symbols.
    for ur requirement u can use the symbol SYM_FILLED_CIRCLE.
    Remember these icons or symbols whatever u will not be able to see in print preview....u have to take a print
    and see
    Now at the time of display check if the line contains the
    tag <BULLET> ( if wa_html-line+0(8) = '<BULLET>')
    if the line has the tag then display ur text in the text element with bullet
    otherwise
    display it in the non bullet text element..
    remeber to remove the tag before dispalying
    hope this solves ur prob...

  • Stripping HTML Tags from a String

    What's the best way to remove html tags from a string (i.e. user input)?

    Can you give an example? You can do substring, if your passing spaces between pages you can do a trim to the variable. Also look at the indexOf(). Look at methods relating to java.lang.String.

  • HTML tag in Coldfusion string not appearing

    Hey guys I'm wondering what I'm doing wrong when trying to
    store an html tag in a string. Basically I'm dynamically creating a
    list for use in a javascript menu, so when building the menu, I do
    this:
    menu = "< ul id = """ & mainID & """
    ><br>";
    to generate a list (of course thats only part of the list
    code). This line produces < ul id = "mainID" >
    What I need is for the spaces to be removed, so it would
    produce <ul id="mainID">
    But in my Coldfusion function, if I write:
    menu = "<ul id=""" & mainID & """><br>";
    nothing shows up! A space between < and ul works fine, but
    once I delete them, nothing! Any help would be really appreciated,
    thanks.

    actually found the answer elsewhere, I declared a variable
    open = &lt; now instead of using the <, i just write open,
    which generates the list fine.
    but a followup, the list is being generated now, but on the
    page instead of the javascript/css menu catching it and formatting
    it, it just displays the whole list, tags and all. I tried
    htmlEditFormat( ), that only changed all the symbols to their I
    guess ASCI couterparts. Any ideas why its showing the list as text
    rather than creating a menu??
    also I tried it without the menu, which should have shown a
    bulleted list, but that didn't work either...

  • How to remove HTML tags from a String ?

    Hello,
    How can I remove all HTML Tags from a String ?
    Would you please to give me a simple example ?
    Best regards,
    Eric

    Here's some code I cooked up. I have created an object that processes code so that it can be incorporated directly into a project. There is some redundancy so that the it can be used in more than one way. Depending on your situation you might have to make the condition statement a little more sophisticated to catch stray ">" tags.
    I have also included a Tester application.
    //This removes Html tags from a String either by submitting the String during construction and then
    // calling getProcessedString() or
    // by simply calling " stringwithoutTags=removeHtmlTags(stringWithTagsSubmission); "
    //Note: This code assumes that all"<" tags are accompanied by a ">" tag in the proper order.
    public class HtmlTagRemover
         private String stringSubmission,processedString,stringBeingProcessed;
         private int indexOfTagStart,indexOfTagEnd;
         public HtmlTagRemover()
         public HtmlTagRemover(String s)
              removeHtmlTags(s);          
         public String removeHtmlTags(String s)
              stringSubmission=s;
              stringBeingProcessed=stringSubmission;
              removeNextTag();
              return processedString;
         private void removeNextTag()
              checkForNextTag();
              while((!(indexOfTagStart==-1||indexOfTagEnd==-1))&<indexOfTagEnd)
                   removeTag();
                   checkForNextTag();
              processedString=stringBeingProcessed;
         private void checkForNextTag()
              indexOfTagStart=stringBeingProcessed.indexOf("<");
              indexOfTagEnd=stringBeingProcessed.indexOf(">");
         private void removeTag()
              StringBuffer sb=new StringBuffer("");
              sb.append(stringBeingProcessed);
              sb.delete(indexOfTagStart,indexOfTagEnd+1);
              stringBeingProcessed=sb.toString();
         public String getProcessedString()
              return processedString;
         public String getLastStringSubmission()
              return stringSubmission;
    public class HtmlRemovalTester
         static void main(String[] args)
              String output;
              HtmlTagRemover h=new HtmlTagRemover();
              output="The processed String: "+h.removeHtmlTags("<Html tag>This is a test<another Html tag> string<yet another Html tag>.");
              output=output+"\n"+" The original string:"+h.getLastStringSubmission();
              System.out.print(output);

  • Want text input containing HTML tags to appear as HTML in output format

    Hi,
    We have a table in Oracle database that has a column named detail,one of its values is like this: <bold><italics>Good Morning</italics></bold>. What our client wants is that the output format should show: <b><i>Good Morning</b></i>. That is,Bi Publisher should be able to parse the HTML tags and provide the desired output. Please tell me how to achieve this. Any help is much appreciated.
    Thanks and regards,
    Debarati,
    [email protected]

    Hi,
    have a look here (http://blogs.oracle.com/xmlpublisher/2007/01/formatting_html_with_templates.html) to get an idea.
    regards
    Rainer

  • Remove HTML tags from a string

    I have a string that contains a couple of HTML or XHTML tag, for example
    lv_my_string = '<p style="something">Hello <strong>World</strong>!</p>'.
    For a special use case, I want to remove all HTML from that string and process only the plain text
    lv_my_new_string = 'Hello World!'.
    Is there any method, function module, XSLT or anything else for that already?

    Hi Daniel,
    I tried using the FM (SWA_STRING_REMOVE_SUBSTRING) but I guess it is expecting a particular pattern which is not so apparent in your case. Iu2019ve written a small piece of code which you can try using in a FM or a PERFORM and that should do the trick. Please let me know if you have any questions.
    PARAMETER: P_LINE(100).
    TYPES: BEGIN OF TY_LINE,
             LINE(100),
           END OF TY_LINE.
    DATA: T_LINE TYPE STANDARD TABLE OF TY_LINE,
          WA_LINE LIKE LINE OF T_LINE.
    DATA: W_LINE(100),
          W_LEN(100),
          W_COUNT TYPE I,
          W_FLAG,
          W_FLAG1,
          W_I TYPE I.
    W_COUNT = STRLEN( P_LINE ).
    DO W_COUNT TIMES.
      IF P_LINE+W_I(1) = '<'.
        W_FLAG = 1.
        W_I = W_I + 1.
        IF NOT WA_LINE-LINE IS INITIAL.
          APPEND WA_LINE-LINE TO T_LINE.
          CLEAR WA_LINE.
        ENDIF.
        CONTINUE.
      ELSEIF P_LINE+W_I(1) = '>'.
        W_FLAG = 0.
        W_I = W_I + 1.
        CONTINUE.
      ENDIF.
      IF W_FLAG = 1.
        W_I = W_I + 1.
        CONTINUE.
      ELSE.
        CONCATENATE WA_LINE-LINE P_LINE+W_I(1) INTO WA_LINE-LINE.
        W_I = W_I + 1.
      ENDIF.
    ENDDO.
    LOOP AT T_LINE INTO WA_LINE.
      CONCATENATE W_LINE WA_LINE-LINE INTO W_LINE SEPARATED BY SPACE.
    ENDLOOP.
    SHIFT W_LINE LEFT DELETING LEADING SPACE.
    WRITE: W_LINE.
    Input:
    <p style="something">Hello <strong>World</strong>!</p>
    Output:
    HELLO WORLD !
    Regards,
    Pritam

  • Pulling Data Containing HTML TAGS

    We have a DB application that allows users to freely enter data. Our problem is that if a users enters HTML tags as their data and submits it to our DB, we are able to encode the response and store the data in it's original context (a requirement).
    Now, here is the problem. When the data is pulled out from the DB and displayed on the HTML page, if the user had submitted HTML tags, our page doesn't display the HTML tags but rather their browser interprets the tag.
    We do not want the browser to interpret the tag, just want the actual characters displayed.
    so if a user enteres <B> HELLO WORLD</B>
    we want the less than and greater than signs to be displayed..not the phrase HELLO WORLD to be displayed in bold.
    Any help is appreicated.

    Darn,
    When you pull the string from the DB, you would be able to pass it through a simple 'filter' method that converts important HTML characters to the display element equivelents.
    For example, you would want to change all < tags to &lt; all & to &amp; and quotes to &quot; This might just about do everything you would need.
    It might be as easy as doing a few
    dbString = dbString.replaceAll("<", "&lt;");
    etc...

  • I require anyones help to extract string from an html tag

    I wanted to extract the strings available in the tag named html
    eg.. <html> Hello </html>
    I require to extract the string Hello into a string variable without using if's
    Secondly,
    i require to extract the name of form in the html tag ..
    eg.. <form name= 'basic'> </form>
    Can any one tell how can this be implemented efficiently.. and using wich concept can this be implemented easily..
    Thanking you,
    bye..
    ur's True friend

    Use a ParserCallback. It notifies you everytime it finds a new tag:
    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=623365
    Or use the HTMLEditorKit to parse the HTML. Then use an iterator to get the tag you need. See reply 5:
    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=655038

  • Reports does not show data which contains HTML tags

    Dear Gurus
    Im trying to resolve this problem but im really stuck in it. I have the requirment to customize PO reports in R12 and at the end of every report we have to show its Terms and Conditions.I have the following query wich brings me the data i need.
    SELECT
    otu.document_number po_segment1,
    otu.document_id,
    otta.template_id,
    otta.template_name,
    otta.description,
    otta.intent,
    otta.status_code,
    otta.start_date,
    otta.end_date,
    otta.instruction_text,
    otu.document_type,
    otu.document_number po_segment1,
    otu.document_id po_header_id,
    osb.HEADING titulo_seccion,
    oav.display_name,
    oav.article_text article_text
    FROM
    apps.okc_terms_templates_all otta,
    apps.okc_template_usages otu,
    apps.okc_k_articles_b okab,
    apps.okc_sections_b osb,
    apps.okc_articles_all oaa,
    apps.okc_article_versions oav
    WHERE otta.template_id = otu.template_id
    AND otu.document_id = okab.document_id
    AND osb.scn_id(+) = okab.scn_id
    AND okab.article_version_id = oav.article_version_id
    AND oaa.article_id = oav.article_id
    AND otu.document_number='21000000111' -- Purchase Document
    AND otu.DOCUMENT_TYPE NOT IN ('RFQ_RESPONSE', 'RFQ','RFI_RESPONSE','RFI','AUCTION_RESPONSE','AUCTION')
    The problem is the field okc_article_versions.article_text storage data with HTML tags as an example : ''<P>COMPANY will make it’s best effort to provide an accurate forecast to CONTRACTOR, <B><I>at the end of every quarter,</I></B> however, a forecast in any form, shall not represent a firm commitment by COMPANY.,</P>"
    So when i tried to show the information my .rtf template nothing comes out. Does anybody knows whats happenig and how to resolve it??
    Please, resolve this issue is more than urgent an i guess somebody have the answe Thanks a lot
    Mily

    Hi ,
    Currently image url have value http://serverip:port/reports/rwservlet
    I don't know is this correct? Suggest What value it should have?
    Thanks
    Vinod

  • Masked HTML tags in substitution strings after upgrade to Apex 2.2

    Hello,<br>
    <br>
    in my application developed with htmldb 2.0 I had the following scenario which worked fine until upgrade to 2.2:<br>
    <br>
    Requirement: a multiline text should be displayed as entered on a html report page.<br>
    My solution:<br>
    - a onload page process of the form <br>
    select replace(description,chr(10),'&lt;br&gt;') into :P1_DESCRIPTION from mytable where id = :P1_ID;<br>
    - and a page template containing <br>
    ...<br>
    <td>&P1_DESCRIPTION.</td><br>
    ...<br>
    <br>
    This worked in HTML DB 2.0.<br>
    <br>
    My problem: After upgrade to Apex 2.2 the report doesn't display the carriage returns anymore. Instead of interpreted BR tags I get masked BR tags printed as text:<br><br>
    <br>this is the first line&lt;br&gt;this is the second line<br><br>
    It's quite obvious that the substitution mechanism changed in Apex 2.2. Any ideas how to change my app ?

    Take a look at this thread:
    Computed Region TItles being Escaped in Apex 2.2
    You may have to change the type of your P1_DESCRIPTION item.

  • How to encode a string containing HTML

    I have a string which contains HTML tags. This will be written to file so i need to encode it i guess to ISO-8859-1
    Please note: i am using JDK1.2.2
    My code is
    bytes = new byte[(int)rs.getString(k).length()*4];
    desc = new String(bytes, "ISO-8859-1");     
    This does not work. The tags remain the same i.e. "<" and ">" are still there in the String. In what format should HTML be encoded and what am i doing wrong above?

    or...
          * Encodes any special characters in the specified string with their
          * entity equivalents. 
          * @param  str  the original string
          * @return  the encoded string
         public static String encodeEntities(String str) {
              StringBuffer sb = new StringBuffer(str);
              // must replace '&' first
              char[] chars = {     // list of characters to replace
                   '&',      '<',      '>',      '\'',      '\"'
              String[] ents = {     // list of entities to replace with
                   "&",      "<",      ">",      "&apos;", """
              int len = Math.min(chars.length, ents.length);
              for(int i = 0; i < len; i++) {
                   for(int j = 0; j < sb.length(); j++) {
                        if(sb.charAt(j) == chars) {
                             sb.replace(j, j+1, ents[i]);
              return sb.toString();
         * Decodes any entities in the specified string with their character
         * equivalents.
         * @param str the encoded string
         * @return the decoded string
         public static String decodeEntities(String str) {
              if(str == null) {
                   return null;
              StringBuffer sb = new StringBuffer(str);
              String[] ents = {     // list of entities to replace
                   "&",      "<",      ">",      "&apos;", """
              String[] chars = {     // list of characters to replace with
                   "&",      "<",      ">",      "\'",      "\""
              int len = Math.min(chars.length, ents.length);
              int k = 0;
              for(int i = 0; i < len; i++) {
                   for(int j = 0; j < sb.length(); j++) {
                        k = j + ents[i].length();
                        if(k >= sb.length()) {
                             break;
                        if(sb.substring(j, k).equals(ents[i])) {
                             sb.replace(j, k, chars[i]);
              return sb.toString();

  • [RB 6i] Format text in the field using HTML-tags. Or another way...

    If some fields of tables in database contain html tags such as 'H<sub>2</sub>O' (here is html tag 'sub') or 'some<b>text</b>'(here is html tag 'b') how can I to make Report Builder 6i to understand these tags or at least don't show them?
    Or how in another way can I format a part of text inside the field?
    thanx before
    Max

    Hi Maxim,
    If the output is PDF, the only way is to filter the incoming values yourself. You will need to create a PL/SQL column and remove the HTML markup tags. This, of course, leaves you without attributes you wanted in text (ie: the no "Bold" characters). You can still do this in with the same report basing the output from the PL/SQl formula column on the "desformat" input parameter.
    Reports doesn't have any "markup" capability. ie: A field only has one font & one colour. You can have multiple fonts for boilerplate text but, again, only a single colour.
    Robin.

Maybe you are looking for