Just before the component is rendered; return value determines whether the component is displayed.

Parameters

none

Property of

All visual components on a report, StreamFrame

Description

canRender fires for visual components only when they are in a report. It is fired every time the object is rendered. For a component in a detail band, that means for every row in the rowset.

While you can use canRender to evaluate some condition and return false to prevent the component from being displayed, the more common use of canRender is to alter a component’s properties conditionally and always return true. You can create a calculated field in a report by altering an HTML component’s text property in its canRender event handler.

You can use the onRender event to reset the component to its default state afterward, or always choose the desired state in the canRender event.

For a StreamFrame object, the canRender event fires before it attempts to retrieve data from its streamSource. Note that it is the rendering of StreamFrame objects that cause additional pages to be scheduled. If a report has only one stream frame, and its canRender returns false so that it is not rendered, no more pages will be printed; the report will terminate. You can call streamSource.beginNewFrame( ) to skip the current stream frame, but in that case, its canRender event handler must return true.