Hello Lloyd,
Like Carl said, using a Panel for creating a report and printing it with its print datamember is the easiest solution.
If you want fancier reports, and additionally want soft copies of them, you can use the Report object. This as you know generates fancy HTML reports. It's kinda powerful because you can include additional stuff in the report using its include datamember.
The problem is, there's no straightforward way of printing the HTML report generated by this Report object from within Lookout. One can always open the HTML file in a browser and print it from there. This requires user intervention and may not be desirable.
Also, if we use the Run and the DOS 'print' command, the HTML tags are printed as plain text (and not the web-page).
The workaround therefore is to use the Run object to launch the HTML file in Internet Explorer and print it. We can automate the printing with some scripting. The best part is, this script can be part of the HTML report itself as we shall see.
The attached file 'onload.txt' has a javascript function to call and execute the "WebBrowser" control. The function WebBrowser1.ExecWB(6, -1); does the main work. Here, '6' is equivalent of "print" command, and '-1' is to suppress the print confirmation dialog.
And then we have a script for registering and using the OnLoad event. This will fire when the HTML file loads in the browser.
We include this 'onload.txt' in our HTML report (see attached LKS file) using the include datamember and launch the IE with it (using the Run object). As soon as the page loads, the page gets printed to the default printer (without prompting the user). As they say, "look ma, no hands!" 🙂
If you want the browser to close itself when it's done printing, you may add the following line
self.close();
as the last line of the printit() function in the onload.txt.
You can of course use a single PushButton in Lookout for generating and printing, etc.
Hope this gives you an alternative. See the attached Lookout process file for details.
Regards,
Khalid