Hand-coding Report-to-PDF and the report preview into a SOURCE template procedure: the classes are not recognized

Applies to: posted in the Clarion 6 group (the poster signs "C6 CR-5"), ABC classes in a procedure built from the SOURCE template.

Problem

Many report procedures are built from the SOURCE template (Clarion). The poster pasted the generated code of a generic report procedure into the SOURCE procedure, into the matching places for the data and class declarations, the initialization code and so on, to get Report to PDF and the report preview. The procedure did not recognize the classes, although they are the ones the Clarion report template generates. 'Allow ABC Classes' was checked in the global settings, and ordinary REPORT procedures worked.

Solution

  1. A second poster's hint: a declaration that is not recognized is not known to the compiler, so check that everything the declarations need is known to it.
  2. The cause was in the generated module. The templates INCLUDE some files in the module data section.
  3. Copy those INCLUDE lines into the same place in the SOURCE procedure's module data section as well.
  4. The poster reported that the classes were then recognized.

Caveats

  • The thread does not list the INCLUDE files. Read them from the generated source of a normal report procedure.
  • The poster also posted a commented source file showing where to embed each piece. It is not in the archive.
  • The poster advised changing the file information in the procedures at the end of the report so that it names the report that actually produces the PDF.

Today (2026)

The method (compare the generated module of a real report procedure with the hand-coded one) likely still holds. Class names and INCLUDE files may differ on a current build; not re-tested.

Sources: Jack O. (Oct 2003, the question and the answer), Hasse O. (Oct 2003), Viggo K. (Oct 2003) in softvelocity.public.clarion6.