All records of a dataset may be inserted in a document as a table rows or in any free form. For this use keywords \Scan(DatasetName)\ and \Endscan\. Inside cycle scan-endscan may be located block of text with data fields, variables and constants, for example:

Lines with words "Scan", "Endscan" are excluded from the result document. However, if in step of designing a report you want to see as will look a result, you may set an attribute "hidden font" for words "Scan", "Endscan".

Full format of scan block is:

\Scan(DataSet) [, while(<boolean value>)] [,page] [,noeof] [,function1,...,functionN]\
.............................................
\Scanentry [,function1,...,functionN]\
.............................................
\Scanfooter [,function1,...,functionN]\
.............................................
\Endscan [,function1,...,functionN]\

If keyword "while" defined in a scan expression, scan block will be terminated when <boolean value> returns false result. "While" is often used with records grouped by some data field. <boolean value> may be a report variable, data field or user defined function.

Option "page" forces to begin every record of scanned dataset (besides first) from new page.

If you use option "noeof" report generator will skip entire scan block if scanned DataSet have no any records. This option is useful when making master-details reports. With option "noeof" scan block will start from current record. DataSet will not be moved to the first record.

Words "Scanentry" and "Scanfooter" are optional. You may add them when using option "noeof" in "scan" keyword, or if you want to develop some special functionality, calling optional scan block functions.

Use option "noeof" with keyword \Scanentry\ to manage scan block with some header section. Every new record of dataset will return control to the position of \Scanentry\ keyword. However, if dataset has no any records, entire block from "scan" to the "endscan" will be missed. For example:

Keyword \Scanfooter\ may be used to manage scan block with some footer section. Every time when report generator gets "Scanfooter", it returns control to the position of \Scanentry\ or \Scan\ keyword. If dataset has no any records, entire block from "Scan" to the "Endscan" will be missed. For example:

\Scanentry\ and \Scanfooter\ may be used simultaneously:

NOTE: It is required to type keywords \scan(...)\, \scanentry\ and \endscan\ all with the same format attributes, for example with  font Arial, 10, regular (or other that you like). It guarantees that format attributes inside block scan-endscan will be correct in output document.

If you use "page" option and a table immediately after "scan" keyword in report template, keep in mind that you should have at least one paragraph (empty line) before the table in the RTF document, otherwise, RTF editor such as MS Word ignores "new page" control.

When editing report template, place keywords \scan(...)\, \endscan\ outside of the table or in the same cell to prevent corrupting of RTF table structure.

Next topic: Sum and Count