var aaathissnippet = this;
if (aaathissnippet.contextObj) {
var aaasiblings = dijit.findWidgets(aaathissnippet.domNode.parentNode);
var aaareportparam = aaasiblings.find(djw => djw.isInstanceOf(reporting.widget.ReportParameter) && djw.parameter === "MyParamName");
aaareportparam.mxcontext.setParam(aaareportparam.parameter, aaathissnippet.contextObj.getGuid());
}
I added an HTML Snippet with Context widget and a Report Parameter widget to the same container and put there the above javascript. Now it sets the dropdown value when the context object is set.
However, I tried adding some string parameters to the query to implement grid search and found that for whatever reason Mendix does not support string parameters in Data Set.