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.
Name of the QueryViewer control in the ControlName property.
Code associated to the event.
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.
If &DragAndDropData.Name = 'ClientAmount'
&GaugeSDT.Value = &UCLinear * &InflationRate
&UCLinear = &GaugeSDT.Value
&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.
Drag And Drop Data property