Showing a HTML - text string

Hello!

 

I have a HTML text string that I would like to show to the user.

As far as I have found, I cannot use the Browser control. This shows a given URL,  not a simple HTML text string.

Can anyone give me a tip for showing a simple HTML text string?

 

Regards Dagl

  • Are you trying to show a HTML tag and it's value?

    77 Form1-Ef-1-Value PIC  X(30)   VALUE IS "<p> test of html </p>".

    01 Form1.

              03 Form1-Ef-1, Entry-Field,  VALUE Form1-Ef-1-Value.

    On display, this shows the tag in the entry-field .. is this what you are looking for?

  • Verified Answer

    If you want to render the html, you'll need to use the Web Browser control.  (Although, there might be a simplified 3rd-party ActiveX control out there that you could use).

    To use the Web Browser control, you'll need to write the HTML out to a temporary line-sequential file, then load it using the "file://" schema in your URL.  Assuming the file is in the current working directory, and you've already defined and displayed a Web Browser control with handle Screen2-Wb-1, then this code should work:

           Screen2-Aft-Create.
               move spaces to current-directory, html-location-url
               call "c$chdir" using current-directory
               inspect current-directory 
                   replacing trailing spaces by low-values
               inspect html-file-name
                   replacing trailing spaces by low-values
               string  "file://"           delimited by size
                       current-directory   delimited by low-values
                       "\"                 delimited by size
                       html-file-name      delimited by low-values
                    into html-location-url
               end-string
               modify Screen2-Wb-1, value = html-location-url
               .