Tuesday, 14 April 2026

WINHTML flags

WINHTML is the procedure to call when one wants to print/save/view an HTML document. There are two flavours to this procedure: the earlier flavour receives a linked table of records and the later flavour that allows each record to be printed separately.

There is an error in the documentation for the later flavour that I will show here. The syntax is

EXECUTE WINHTML '-d', 'document_name', 'table', 'linked_file', '-v', 'record_id', ['-trc', debug_file,] ['-s',] ['-e',] ['-edoc' | '-signpdf',] ['-format', format_num,] ['-lang', lang_num,] ['-AMAIL',] ['-o' |'-pdf' | '-wo' | '-wpdf',] ['output_file',]

Here is an example using this syntax. The output is sent to a PDF file that is later sent to an email address.

:FNAME = STRCAT (:DISK, :PAR2, '.PDF'); EXECUTE WINHTML '-d', :ENAME, '', '', '-v', :ADOC, '-format, -10', '-pdf', :FNAME; MAILMSG 5 TO EMAIL :EMAIL DATA :FNAME;

Returning to the documentation, the description of the '-s' flag is that it supresses the notification window that pops up when preparing the document. In my experience, it does not supress the notification, but more importantly, it causes the document not to appear, or in the case of my example code, no PDF code is created!

So DO NOT USE THE -s FLAG!

No comments:

Post a Comment