Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: HTML Content display

Former Member
0 Kudos
193

Hi All,

I am having a requirement of displaying a HTML content(which is in internal table) in a text editor. Generally HTML content will have tags as shown below.


<html>
<head>   <title>Sample</title>  </head>
<body>
<basefont size=1>
<table border>
<tr>   <th>Bengaluru<th>  </tr>
<tr>   <th>Pune<th>         </tr>
<tr>   <th>Delhi<th>         </tr>
<tr>   <th>Goa<th>          </table>
</body>
</html>

I have to display this content in text editor with out these tags as if it is shown when we open this document in browser. Awaiting replies

Thanks,

Ravee..

1 ACCEPTED SOLUTION

Former Member
0 Kudos
144

Hi Rave,

Try using this logic.

1. Read each line.

2. Consider offset for each line.

3.Increment each character and where you find '<' or '>' or '/' like that you can delete them before appending.

Hope it helps!

Much Regards,

Amuktha.

5 REPLIES 5

Former Member
0 Kudos
145

Hi Rave,

Try using this logic.

1. Read each line.

2. Consider offset for each line.

3.Increment each character and where you find '<' or '>' or '/' like that you can delete them before appending.

Hope it helps!

Much Regards,

Amuktha.

0 Kudos
144

Hii Amuktha,

I am having your answer as one of the option with me.Thanks for your reply and i an awarding points for you even.

But My doubt is if we take following text in a text document and change the extension of file to HTML,we can open it in the browser. Then if we view the source then it shows following content it self.


Pune
Benagaluru
Delhi
Chennai

But in the other case,if we have following content in text do and if we open it in browser and view source it will be different. I think that makes the difference


<html>
<head>   <title>Sample</title>   </head>
<body>
<basefont size=1>
<table border>
<tr> <th>Raveendra<th>                    </tr>
<tr> <th>poothineedi<th>                  </tr>
<tr> <th>EDS an HP company<th>    </tr>
<tr> <th>Vizag<th>                           </tr>
</table>
</body>
</html>

Please clarify..

Thanks,

Ravee

Edited by: ravee on Feb 27, 2009 6:13 PM

0 Kudos
144

the commands in between <> are html tags and they help to format the output, so if u want to see only output without the tags use html container as mentioned in my previous post. it will be as if u are seeing it in ur browser.

кu03B1ятu03B9к

0 Kudos
144

Thanks Karthik

Former Member
0 Kudos
144

check this class

cl_gui_html_viewer.

check this piece of code given by rich in below mentioned thread u can modify it for ur use

* Load the HTML
  lo_html->load_data(
    exporting
      type         = `application`
      subtype      = `pdf`
    IMPORTING
      assigned_url         = lv_url
    CHANGING
      data_table           = lt_data
    EXCEPTIONS
      dp_invalid_parameter = 1
      dp_error_general     = 2
      cntl_error           = 3
      OTHERS               = 4 ).
 
* Show it
  lo_html->show_url( url = lv_url  in_place = 'X' ).

кu03B1ятu03B9к

Edited by: kartik tarla on Feb 27, 2009 6:05 PM