Consider the example in section on page . Suppose you wanted to generalize this report to print an arbitrary number of lines per person, and to report for only selected persons.
One way to do this would be to use two macros: "_count" and "_where". Then change line 3 of the report to <"select from techs _where" and change line 12 to <"while loop <_count"
Define these macros before running the report.
For example,
<"macro _count = 10; macro _where = ' '"
"input forms"
or
<"macro _count = 7;"
"macro _where = 'where position = "Tech 1"'"
"input forms"
You can make this operation much more friendly through the use
of this "run" macro. <"macro run = +"
" 'macro arg_1 = "' 2 '";' + "
" 'macro arg_2 = "' 3 '";' + "
" 'macro arg_3 = "' 4 '";' + "
" 'input ' 1"
Here is what happens when you type <"run forms 5 'where position like "Tech*"' "
Of course, the report program on file "forms" must be aware of this "run" invocation. It should be written as follows.
*( data entry forms ) *( use is: RUN filename count where_clause ) report select from techs arg_2 print 1 1 id i5 1 10 name a20 4 10 'symbol date time resistivity ' 5 1 ' ' end print loop = 1 while loop <= arg_1 print 1 5 loop i2 2 10 '------ -------- ----- ----------- ' end print loop = loop + 1 end while newpage end select end report
to produce the output shown on page .
Reports|)