Object: PageDropContext
- Updated2024-09-12
- 2 minute(s) read
DIAdem REPORT > Objects > Context Objects > Object: PageDropContext
Object: PageDropContext
The PageDropContext object provides information about the page onto which you dragged and dropped an object. Do not set the DoProceed property to TRUE if you change the number of pages in the associated event or if you execute similar operations.
![]() | Note To test the example script, you must first save the script and register the script as a user command in the dialog box that opens when you select Settings»Extensions»User Commands. |
The example executes the user command MyOnDropPageEvent when dragging groups, channels, or properties onto a worksheet. The user command displays the names of the elements that you dragged onto an object. In addition the user command displays to which position you dragged the elements. The user command receives two parameters. The first parameter corresponds to a PageDropContext object and provides information about the worksheet onto which you dragged and dropped an object. The second parameter corresponds to a DropInformation object and provides information about the object which you dragged and dropped onto another object:
Call AddUserCommandToEvent("Report.Events.OnDropPage", "MyOnDropPageEvent") Sub MyOnDropPageEvent(Context, DropContext) Dim oMyDropElement, sOutput, oMyComment sOutput = "Names of dropped elements:" For Each oMyDropElement in DropContext.DiademElements sOutput = sOutput & VBCrLf & oMyDropElement.Name Next Call Msgbox(sOutput) Call MsgBox(Context.Sheet.Name & VBCrLf & Context.Position.X & VBCrLf & Context.Position.Y) Context.DoProceed = TRUE End Sub
