When a user moves Query Elements, using Drag&Drop, between the axes of a Pivot Table, it may be necessary to execute a particular code (to recalculate values, change colors, etc.) To do so, the QueryViewer's DragAndDrop event must be programmed.
Syntax
Event QueryViewerControlName.DragAndDrop
Event_code
EndEvent
Where:
QueryViewerControlName
Name of the QueryViewer control in the ControlName property.
Event_code
Code associated to the event.
Example
In this example, when the “ClientAmount” query element is dragged to another axis, the clients’ investment amount is recalculated by a given inflation rate so that the new variation obtained can be indicated through the Web Linear Gauge.
We have a Web Panel where we have inserted the QueryViewer control, and in its Object property we have placed ClientsQuery, the Query object name.
Event QueryViewerClients.DragAndDrop
If &DragAndDropData.Name = 'ClientAmount'
&GaugeSDT.Value = &UCLinear * &InflationRate
&UCLinear = &GaugeSDT.Value
EndIf
EndEvent
&DragAndDropData is the variable that was set in the Drag And Drop Data property.
Note: For &GaugeSDT and &UCLinear variables, take a look at Additional Elements to Examples of Query Viewer Control Events; for ClientAmount take a look at Client Transaction and ClientsQuery Query Object.
Scope
See Also
Drag And Drop Data property