core

#### Passing Information to an ActiveX Control

For all of the PC-DMIS ActiveX controls described here, the software passes information into the control using the EventReportData event. PC-DMIS encapsulates the specific dimensional information into an object called ReportData (see the "ReportData Object" topic in the PC-DMIS 2019 R1 Object Library documentation for additional information ). For example, if you look at the Rule Tree Editor for the TextOnly.rtp report template, you will find for the Dimension Location item that one of the rules is:

Use Template "legacy_dimension.lbl"

The Legacy_dimension.lbl label template receives the dimensional information about the location dimension via the ReportData object. The information is now in the label but it has not yet been passed to the ActiveX control.

To understand how this information gets passed:

1. Open the legacy_dimension.lbl label template in the Label Template Editor. You will see that it contains a GridControlObject named ActiveX12.

2. Right-click to display the Properties dialog box for the object.

3. Double-click on one of the cells in this grid control to put it in edit mode.

4. Click the cell in the lower right corner. This cell uses the Dimension Report Linear control. Notice that the Properties dialog box has four categories of properties (Standard, Advanced, Events, ActiveX). Normally, objects only have three categories (Standard, Advanced, Events). This fourth category, ActiveX, is unique to ActiveX controls and is the area we will be concentrating on in the following sections.

5. Expand the Events section.

6. Access the EventReportData property. The VBA Mini Editor appears. Notice that the editor contains this line of code:
   This.X.EventReportData ReportData

This code is the mechanism that passes ReportData (the dimensional information) to the ActiveX control. Therefore, whenever you add an ActiveX control to a label template, you will need to set the EventReportData property to do the same thing by using that line of code.