Run-Time Designer Introduction

The run-time designer control allows you to host the ActiveReports designer your application and provide end-user report editing capabilities. The control's methods and properties provides easy access to save and load report layouts, monitor and control the design environment and customize the look and feel to the needs of your end users.

Persistence API

The designer control's Report property provides access to the layout elements of the report, its sections and controls. The persistence API allows you to save and load the report layout. It includes the following properties and methods.

LoadFromObject loads the report layout from an existing report object into the designer.

SaveToObject, apply the new layout to an existing report object.

NewLayout clears the current layout, including sections, controls and starts a new report layout. All property settings are returned to default values.

IsDirty, this property returns whether the report has been modified since the last save or load operation. It can be used to enable/disable a save button.

User Interface Customization

API's for User Interface customization have the goal of providing hooks into the designer that will let developers attach their own custom menus, toolbars, field/database browsers, script editors, alert dialogs and property sheets.

Toolbars and Menus

You can replace built-in menus and toolbars by first setting the ToolbarsVisible, ToolbarsAccessible properties on the designer control to hide the built-in UI.

All menu and toolbar commands are called actions. There are over 50 actions that are defined in the designer control.

If you are using a pull method to update your toolbar and menu states using idle-time processing, you can use the QueryStatus method to check if a certain action (such as Edit/Cut) is enabled/disabled, checked/unchecked.

In addition, the designer control fires StatusChange event when the status of the tools change allowing you to update the UI to reflect these changes.

ExecuteAction method provides the ability to perform most of the designer functions with a single call. Alternatively, actions that are not supported by ExecuteAction (ones that require a parameter such as color, style and font settings) can be executed by setting the control or section properties directly using the Report property.

Designer Surface

The grid settings can be modified using the following properties

Property Sheets

The runtime designer control allows you to replace the built-in property toolbox and provide your own selection editing UI. The SelChange event fires when the user changes the current selected object in the designer. You can retrieve a list of the selected object using the SelectedObjects collection.

ActiveReports Professional includes a property listbox ActiveX called "Data Dynamics Property ListBox" that can be used to create customized design environments based on your users needs.

Script Editor

The built-in syntax-highlighting script editor is invoked using the ExecuteAction method and the action code ddActionViewCodeEditor. To replace it with your own editor, create your own toolbar/menu item and use the ActiveReport.Script, Section.Script properties to get/set the script. The scripting language is can be set using the ActiveReport.ScriptLanguage property.

Controls Toolbox

The toolbox contains the controls that can be placed on a section. You can create your own toolbox toolbar and use the following properties and methods to interface with the designer:

ToolboxItem property: Setting the ToolboxItem property initiates the control-add mode using the ProgID set to the property. The user will use the rubber-band to select the area of the control and once the area is selected the designer will add the control specified by ProgID and end the add mode by setting ToolboxItem to an empty string.

ValidateChange Event: This event fires after any changes that are made to the report layout. It allows you to control what the use can or cannot do in the designer control. Within the event code your can cancel the layout change and revert it back to its original state.

LayoutChanged Event: After the layout change (control addition, deletion is validated this event will fire with changeType=ddLCControlAdd to notify the application that a new control has been added.

Alerts and Error Messages

ActiveReports runtime designer allows you to intercept runtime errors and alert messages and present the user with custom notification UI. For each error or alert message ActiveReport Designer control fires an Error or Alert event with the message id and string and gives you the option to cancel the internal display when you handle the messages.