Test Connections
 

One method for printing an HTML file from within an ATEasy application is to use the ALog control. This can be done as follows:

1. Create a form and uncheck the form Visible property.
2. Place an ALog control in the form and set it's PlainText property to False for HTML or True for text file
    printing.
3. Create a public procedure with one parameter that contains the location and name of the HTML file to be
    printed.
4. The procedure should load the form in Modeless mode, set the logPrint.LocationURL to the HTML file location,
    call logPrint.PrintLog and then return.

The example that accompanies this KB article is located here: Q200180.zip. In the example the form used to print the HTML file is called PrintHTMLForm. The public procedure used to call the form and print the file is called PrintHTML(). The same code can be used to print TEXT (log) files. The procedure code is detailed below:

PrintHTML(sFile)
  {
! Declare a PrintHTMLForm form variable called frmPrintHTML

Load frmPrintHTML, False, 0  !Load the PrintHTML form
DoEvents()   !Process all pending operations
frmPrintHTML.logPrint.LocationURL=sFile  !Set the URL of the file to be printed

!Wait for the file to be loaded
while frmPrintHTML.logPrint.ReadyState <> alogReadyStateComplete
  DoEvents()
endwhile

frmPrintHTML.logPrint.PrintLog()  !Print the file
Unload frmPrintHTML
frmPrintHTML= Nothing
  }
(If the Print button is not supported, simply use your
Web browser's "Print" command instead.)

Geotest-Marvin Test Systems, Inc.
1770 Kettering
Irvine, CA 92614
1-949-263-2222
1-888-837-8297

Geotest - Marvin Test Systems, Inc.
©2011 Geotest-Marvin Test Systems, Inc. (www.geotestinc.com). All rights reserved.
Geotest - Marvin Test Systems, Inc. - Geat A Head Start With Geotest