Adding a Select Printer button to the standard report previewer, to print one report to two printers

Applies to: ABC chain; posted in the Clarion 6 group. The thread names abreport.clw and the PrintPreviewClass.Display method.

Problem

A customer must print the same report to two different printers without regenerating it. The poster looked for the template holding the preview window and its accept loop to add a Select Printer button.

Solution

  1. The preview is not in a template. In the ABC chain it is in the PrintPreviewClass.Display method (line 284 of abreport.clw in the poster's source).
  2. Changing it is not easy: after the preview is flushed to the printer the temporary .wmf files are deleted. You would have to save the .wmf files and the ReportManagerClass.PreviewQueue and restore them. A different printer may also need the pages generated again.
  3. The PreviewWindowClass only shows the .wmf files; ReportManagerClass does the flushing, so that behaviour would need rearranging.
  4. One poster suggested calling the report procedure in a loop instead: LOOP UNTIL PrinterDialog('Select Printer') = '' then PrintProc, then END.
  5. Another builds a dynamic report with one detail holding one IMAGE control, shows the printer dialog, and prints the preview .wmf files to the chosen printer through that report. The original report is untouched and you stay in the previewer.

Caveats

  • Option 5 was described as tested with several customers over a year by its author; the thread shows no code beyond the report skeleton.
  • A third poster saves the .wmf files into a blob field of a TPS file so a report can be reprinted later.
  • The original poster thought the job might be more than he could take on and did not report an outcome.

Today (2026)

Not re-tested. The class names and the .wmf preview flow may have changed; check the current abreport.clw first.

Sources: Jack O. (Dec 2003, the question), Arnor B., Chris B., Sebastian S. (Dec 2003 - Jan 2004) in softvelocity.public.clarion6.