Simplicty and flexibility!


Function::File

PrintHTML
PrintHtml(HTMLFileToPrint,Printer,Mode)
PrintHtml("C:\temp\mytestfile.html","",1) -- print to default printer, print preview.
retval := PrintHtml(MyHtmlFile,"",3) . -- print to default printer with dialog.


To print the content of a text file as HTML via the built in HTML object.  Will print the file as formatted HTML, but can be used to print normal text files as well. They will then be printed with the standard formatting of the HTML object.

Currently will only print to default printer (which can be changed via CDF) but will be changed to print to named printer.

Parameters


FileToPrint: Text

This is the filename of the file that you want to print. It can be local to the function or you can look it up via a realtionship.

Printer

This parameter is not yet implemented. It will be implemented so you can either use a Printer name or Printer1-4 (Application Printers).

Mode

0 = Screenprint (preview) - currently same as 1.
1= Print Preview in Browser object.
2=
Print directly to default printer without dialog.
3=Print dialog.

Returns/Result


Nothing

Examples


Reference

So why do we add a function like this. Is it DataEase job to print a text/html document?

Yes, it is now!

In DataEase 8 you can generate a Text/HTML document in several ways. For redundancy and flexibility we "replicate" functionality in two difference scenarios. In one scenario we use the Memo field as the direct storage class, but you can also use files directly. Using one or the other is down to you, but sometimes it is better to use a file (memo is limited to 32k anyway), and sometimes it is better to use Memo.

You can now for instance use a DQL and MemoWriteToFile with the append option to dynamically create an output file/export file.

If it is an export file, fine. But if you for instance built a HTML invoice, letter etc, you might want to print it directly. And this is what PrintHTML() does.

It is not secret that formatting printing in DFW is a nightmare, and we haven't spent our time trying to fix this. It should have been done 20 years ago, but the reason they never did is that the way printing was implemented in DFW was a mistake, and a big one.

It might have been possible to correct this back then, and it might have made a big difference, but now it is simply to late. Instead of doing brain surgery on this difficult code, we try to go around it by offering alternative routes.

With the new MemoClass functionality, you can create any document dynamically and print it as HTML. This means that you can format it anyway you like, and a WYSIWYG finally means something. You will also be able to print "size to fit" etc, and dynamic formatting...high time!

Over the next year we will also publish a spin off from our DG3 development DataEase 8 Reporter. This is a standalone tool where you can make Reports/DQL's etc proper DataEase Style against your DataEase 8 data.

You can also dynamically include the reports/prints in your DataEase 8 through the WebField interface.

Sound to good to be true? He,he....wait and see!

See Also


On the forum about PrintHTML

On the blog about PrintHTML

New Function 8 - PrintHTML() - Use DataEase Webfield functionality to print a file as HTML (Ver. 8.0.0.1085)

So why do we add a function like this. Is it DataEase job to print a text/html document?Yes, it is now!In DataEase 8 you can generate a Text/HTML document in several ways. For redundancy and flexibility we "replicate" functionality in tw...

Product: Dataease [{8}]FIVE. Written by DataEase 02/06/12 at 08:56:49


dg3_HelpView