Skip to content

Template

The DataFlex Reports library contains one component template that can be used to create a Web component in the DataFlex Studio. With this template, you can build the same kind of component as with the wizard when no selection criteria are selected that the end user can change. The difference is that you need to do it all 'by hand'. The created Web component includes a cDRReport object, a sort order selection group, an output 'window' for PDF, and a run report button.

oReport Object

This is the DataFlex Reports proxy object that allows your DataFlex Reports program to access the report, alter filters, change sorting, and then run the report. By default, the report object stores its object ID in the phoReport property of the ReportView object.

Events

All events defined for the cDRReport class are supported and can also be found in the events tab-page of the object properties panel in the DataFlex Studio.

The template sets up three events:

The OnPageChanged and OnZoomChanged events communicate with a toolbar 'button' object. As it is common to configure the report execution, the OnInitializeReport event is also added to the object.

Button Objects

Finally, the template adds two buttons to the ReportView object. The button named oRunButton sends RunReport to the report object via the object ID in phoReport. The button named oCancelButton attempts to close the component.

To allow the user to easily execute the messages that the buttons send, two On_Key statements are added; these send the KeyAction messages to the appropriate button. The key combinations are Alt+C and Alt+R.

Other Key Mappings

The template also defines On_Key statements for navigating to the first (Ctrl+Home), next (PageDown), previous (PageUp), and last page (Ctrl+End) of the report.