Skipping a report row when a total computed from child records is zero (balance due)

Applies to: ABC report procedures; posted in the Clarion 6 group.

Problem

A report adds up the amount due from visits and payments. The balance due is a local variable in the report procedure and is computed from several child records. The poster wanted to print a parent only if the balance due is greater than zero, and asked for an embed that can say "print this" or "do not print". The filter prompt did not help because the value is not known per record, and ValidateRecord did not fit because the records read are not individually related to the balance.

Solution

  1. Use the embed after the parent TakeRecord call, where the child summation is already done and before the PRINT.
  2. Add the child summation loop there.
  3. If the balance due is zero (out of range), return Level:Benign before the PRINT, so the row is skipped.
  4. The poster confirmed that returning Level:Benign did it.

Caveats

  • A first answer, to compute the value in ValidateRecord and return Record:Filtered, works only when the value can be computed there.
  • Another poster uses a second pass: the first pass picks the qualifying parents into a queue with sorting fields, then the report prints from the sorted queue.
  • Two posters recommended a third-party report template, and one recommended a book on ABC for working out the embeds. The thread did not test them.

Today (2026)

Likely unchanged for ABC reports; not re-tested.

Sources: Raul R. (Mar 2008, the question), Steven P., Paul H., John S., Jim B., Ramon R. (Mar 2008) in softvelocity.public.clarion6.