A TDetailFrame is a dynamic band frame that can be linked as a "detail frame" to a parent TPageFrame or TMasterFrame via their DetailFrame property, or executed independently at any point in a report by calling TDetailFrame.Execute(ReportWriter). It provides a single "code loop" to cycle through "rows" in a report, but lacks the "grouping details" of a TMasterFrame.

Studying this diagramme and understanding it well can be the key to effectively using a TDetailFrame.


Control Flow for a TDetailFrame

When executed, a TDetailFrame component cycles through a sequence of band output events: OnBodyHeader, OnRow and OnBodyFooter. These output events are where you write your report output code. Each output event is preceded by a corresponding automatic band setup/definition process where band font and tab settings are applied. It includes a repeated loop which continues to cycle until invalidated in code by setting event parameter Valid := False within the loop.

Appropriate before/after events allow you to manipulate the process and add data access or other report infrastructure code.

The flow of events is represented in this diagramme:

Detail Frame

Notes:

  1. The "Body" output events (OnBodyHeader and OnBodyFooter) start and conclude output of the "row band" of the report (the repeated loop part of the frame).
  2. There is no linked sub-frame property in a TDetailFrame. Use a TMasterFrame instead if this is required.