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: 

Can I send output from CL_GUI_HTML_VIEWER to a pdf or to a spool file?

margaretk
Participant
0 Kudos

I am using CL_GUI_HTML_VIEWER to display an html form. Users enter some text and other data and then I need to be able to save the form to a pdf. Output to a spool file would also work.

Any ideas?

1 ACCEPTED SOLUTION

horst_keller
Product and Topic Expert
Product and Topic Expert

The browser control has a method EXECWB.

See my demo class CL_ABAP_BROWSER that encapsulates CL_GUI_HTML_VIEWER and where method SHOW_HTML has a parameter PRINTING that allows to desktop-print the displayed HTML using that method EXECWB.

Maybe you can go on further from this.

4 REPLIES 4

horst_keller
Product and Topic Expert
Product and Topic Expert

The browser control has a method EXECWB.

See my demo class CL_ABAP_BROWSER that encapsulates CL_GUI_HTML_VIEWER and where method SHOW_HTML has a parameter PRINTING that allows to desktop-print the displayed HTML using that method EXECWB.

Maybe you can go on further from this.

0 Kudos

Hello and thank you for the response.

Your CL_ABAP_BROWSER class is excellent. I used the class in a small demo program for my business users with success.

However (as often happens in the early stages of such ideas), the business users have now changed the requirements and have requested that we use a word document instead of html. I choose to look at this as an opportunity to explore a BDS solution.

0 Kudos

Hi,

I tried to generate spool by using above method.It's not working can you send me if you have any sample code.

Thanks in advance.

margaretk
Participant
0 Kudos

Hello Prashanth,

I did not find a way to generate a spool file or a PDF from the HTML form. The CL_ABAP_BROWSER provided by Horst Keller allows desktop printing of the display HTML. That worked well for me in testing. However, as happens sometimes, my users changed their minds on the requirement so I did not complete the code.