How a report is rendered
When a Report object’s render( ) method is called, the first thing the report does is check its firstPageTemplate property to find the first page to render. It renders the page by rendering all the components and StreamFrame objects assigned to it, in the order they were originally created (the same order as they appear in the class definition in the .REP file).
To render a StreamFrame object, dBASE Plus looks to its streamSource property. The Band objects in that StreamSource object—the detailBand and the headerBand and footerBand of any groups—are rendered in the StreamFrame object to fill it with data.
Before each component in the band is rendered, its canRender event fires. The canRender event can be used to supplement the suppressIfBlank and suppressIfDuplicate properties of the Text component by returning false, but it is more often used to alter the properties of a component just before it is rendered. For example, you can set a component’s colorNormal to red if it’s going to display a negative number. When used this way, the canRender event handler does what it wants and returns true, so that component is rendered. After the component is rendered, its onRender event fires. You can use the onRender event to reset the component to its original state.
Until the data from the StreamSource object is exhausted—that is unless the StreamSource object’s rowset reaches the end-of-set—dBASE Plus knows that it needs to fill another StreamFrame. If there is another StreamFrame object in the same PageTemplate that used the same streamSource, the report engine will continue to stream bands from that StreamSource into that StreamFrame.
For example, if a PageTemplate has three tall StreamFrame objects side-by-side that have the same streamSource property, data would be printed in three columns on each page. To create a page of labels, create one StreamFrame for each label, all with the same streamSource property. Then set the beginNewFrame property of the streamSource’s detailBand to true, so that each row of data is rendered in a new StreamFrame.
If there are no more StreamFrame objects that can be filled on the current page, another page is scheduled. The current PageTemplate object’s nextPageTemplate property refers to the PageTemplate to use.
Once the current page has finished rendering, the Report object’s onPage event fires. If there is another page scheduled, it is rendered. Its StreamFrame objects are filled with data and the process repeats itself until all the StreamSource objects are exhausted. The onPage event fires one last time and the report is done.