Try OpenEdge Now
skip to main content
Programming Interfaces
Input/Output Processes : Creating Reports : Report basics : Control blocks and output statements
 
Control blocks and output statements
Compiling a report usually involves a straightforward process of moving through a set of table records, calculating data, and outputting results. A control block best handles the report-generating process. Most reports use the FOR EACH block because of its record-reading properties. For example:
FOR EACH Customer NO-LOCK WITH FRAME Frame1:
lBalDue = IF Customer.Balance > 0 THEN TRUE ELSE FALSE.
  DISPLAY Customer.Name lBalDue.
END.
The default frame of an iterating control block is a down frame.
The DISPLAY statement is ABL's main programming statement for output. DISPLAY can output to printers and media as well as the screen. Later, you'll learn about another output statement and how to direct output.