Using a Web Browser Control to Display and Print Reports

The ACUCOBOL-GT Web browser control, described in Control Types Reference, is a useful tool when you deploy a program that includes graphical reports. The Web browser control can parse and display both character and graphical reports, though its advantages are most clearly seen with graphical reports.

All you need to use this method to display and print reports are a screen containing a Web browser control and a program containing a report. The basic steps are as follows:

  1. Design the screen and the report. Make sure that you know the output file name and path for the report.
  2. Include code to perform the generated Acu-report-Print-ToFile paragraph.
  3. Move the name and path of the generated report file to the value variable associated with the Web browser control.
    MOVE "c:\reporting\data\pets.html" TO ws-browser-url.
  4. Add code to print the report. To allow the user to choose from various printers on the network, the code looks like this:
    MODIFY my-browser-control, PRINT=1

Information about printing to a default printer or giving the user the option to perform page setup operations can be found in Control Types Reference.

There are significant advantages to using this method to display and print reports: