Applies to: a report structure created in a Window template procedure (Data embed, Ctrl-F); posted in the Clarion 6 group.
Problem
A report was created on a window template procedure. The poster asked how to trigger (print) it, and later how to add the preview.
Solution
- A report made this way is only a report structure. The template does not print it, so you code the printing by hand.
- Without preview:
OPEN(Report), thenPRINT(RPT:Detail), thenCLOSE(Report). The poster confirmed this works. - With preview, set the report output to metafiles and follow the help on PREVIEW and PrintPreviewClass:
- Define a PreviewQueue.
- Define a PrintPreviewClass object.
- Assign the PreviewQueue file name to the report.
- Set the properties of the class object, call its Display method and handle the value it returns.
- A shortcut from another poster: generate a report from the report template without preview and again with preview, compare the generated source and copy the preview lines across.
Caveats
- One early reply suggested ENDPAGE(Report); the poster did not take it up.
- The poster decided to use an ordinary template-generated report whenever he needs preview, because it is quicker.
- The thread does not show a working preview code listing.
Today (2026)
Likely unchanged for the OPEN, PRINT, CLOSE sequence. Not re-tested; check the PrintPreviewClass help for your build.
Sources: Rupert E. (Mar 2008, the question), John G., Shankar, Paul H. (Mar 2008) in softvelocity.public.clarion6.