ActiveReports 9
Run Time Layouts
Show AllShow All
Hide AllHide All

ActiveReports objects and controls are completely accessible at run time. You can modify the properties of any of the report sections or controls to produce a dynamic report. The section Format event allows you to modify the properties of the section and its controls, including height, visibility, and other visual properties. The Format event is the only event in which you can modify the printable area of a section. Once this event has run, any changes to the section's height are not reflected in the report output.

This walkthrough illustrates how to create a report layout at run time based on user input.

Note: Add controls dynamically in the ReportStart event, otherwise, results may be unpredictable. For more information on events, see the Section Report Events topic.

This walkthrough is split into the following activities:

Note: This walkthrough uses the NWind database. By default, in ActiveReports, the Nwind.mdb file is located in the [User Documents folder]\GrapeCity Samples\ActiveReports 9\Data folder.

When you complete this walkthrough you get a layout that looks similar to the following at design time and at runtime.

Design Time Layout (Windows form)

Runtime Layout

To add an ActiveReport to the Visual Studio project

To add controls to the form

To generate a dataset for the Form

To add code to create the report layout

To add code to fill the check list with fields and to launch the report

To add code to alternate colors in the detail section

To add code to the ReportStart event to call the report layout code

To add code to the button's Click event to collect the selected values and launch the report

To add code to enable the button when fields are selected

To add code to the Form_Load event to call the fill check list code

To view the report

 

 


Copyright © 2016 GrapeCity, inc. All rights reserved

Support Forum