Hello,
I am trying to filter a report using the option of data-driven html form, but I can't return the selected value of the buttons in the report, the buttons are created in the html form.
Below is the code i use:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="../util/messagingUtil.js"></script>
<script type="text/javascript" src="./util/contentUtil.js"></script>
<title>SAS</title>
</head>
<body>
<h1>HTML DOM Events</h1>
<h2>The onclick Event</h2>
<p>Select one the following choices:</p>
<div id="buttons">
<button id="option1" onclick="selectOption('A')">A</button>
<button id="option2" onclick="selectOption('B')">B</button>
</div>
<div id="result">
<p> </p>
<p> </p>
</div>
<script>
function selectOption(text) {
let selectedText;
var selection=[];
var vaResultName;
selectedText = text;
document.getElementById("result").innerHTML = selectedText;
selection.push(selectedText){
return test == selectedText
}));
va.messagingUtil.postSelectionMessage(vaResultName, selection);
x.innerHTML= "Your selection is " + test;
}
</script>
</body>
</html>
What needs to change to return my variable to the report?
Thanks,
Charis
You will need to follow the api for handling selections and posting those back to the report, I'm assuming you want your DDC to be used as the source of an action.
Here is the doc for this, as well as an example from github
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.