Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Dagl Absent Member.
Absent Member.
1427 views

Showing a HTML - text string

Jump to solution

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

0 Likes
1 Solution

Accepted Solutions
Chuck Edgin Absent Member.
Absent Member.

RE: Showing a HTML - text string

Jump to solution

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
           .

View solution in original post

0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

RE: Showing a HTML - text string

Jump to solution

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?

0 Likes
Chuck Edgin Absent Member.
Absent Member.

RE: Showing a HTML - text string

Jump to solution

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
           .

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.