Using calculation fields in report writer
We've had some queries recently on using calculation fields in report writer; here's an
explanation of how to do it.
When using merge-store to generate a report from a datafile,
any fields in the report form must be written in terms of
fields that exist in the datafile.
Calculation fields are not stored in datafiles. Even if a
datafile is created using a form containing a calcuation
field, that field name will not be recognised by the report
writer - it needs to be defined in full in terms of the other
fields it depends on.
For example, you can define field suma=a1+a2 in the report form,
provided that a1 and a2 are in the datafile.
You can also use calculation fields that depend on other
calculation fields in a report, provided that all of them are
defined in full. For example, define the fields suma=a1+a2,
sumb=b1+b2 and
sumtotal=suma+sumb.
The field sumtotal will be interpreted correctly,
providing a1, a2,
b1 and
b2 all exist in the datafile.
If you do not want the intermediate calculation fields to
show up in the report, simply define them as hidden fields in
the report form.
Return to the top of this page.
|