This has limited use – the code below will only work with a table containing 1 dimension & 1 measure
When a user clicks a cell in the table, the clicked value will be displayed in a text box.
The Script below is placed in the ‘onSelect’ event of a table
var sel = this.getSelections()[0];
var dim = this.getDimensionsOnRows()[0];
var measure_sel = sel[Alias.MeasureDimension];
if(measure_sel ===undefined)
{ var result = this.getDataSource().getResultMember(dim,sel).description;
txt_box.applyText(result); }
else { var value2 = this.getDataSource().getData(sel).formattedValue;
txt_box.applyText(value2); }
Code language: JavaScript (javascript)
