For manually insertion of the Option values into the combobox.
<script type="text/javascript">
function prepopulate(reportType){
document.form1.report_view.options.length = 0;
if (reportType == "Pie_Chart" || reportType == "Bar_Graph"){
document.form1.report_view.options[0] = new Option("Adobe Reader (.pdf)","pdf");
document.form1.report_view.options[1] = new Option("Open Office (.odt)","odt");
}else{
document.form1.report_view.options[0] = new Option("Adobe Reader (.pdf)","pdf");
document.form1.report_view.options[1] = new Option("Microsoft Excel (.xls)","xls");
document.form1.report_view.options[2] = new Option("Open Office (.odt)","odt");
}
}
</script>
In the html part:
<select name="report_type" id = "report_type" onChange="javascript:prepopulate(this.value)">
<option value="Consolidated_Comments">Consolidated Comments</option>
<option value="Pie_Chart">Consolidated Result - Pie Chart</option>
<option value="Bar_Graph">Consolidated Result - Bar Graph</option>
<option value="Individual_Results_Comments">Individual Results (Comments)</option>
<option value="Individual_Results_FreeText">Individual Results (Free Text)</option>
<option value="List_of_Questions">List of Questions</option>
<option value="Individual_Comment">Individual Result</option>
</select>
<select name="report_view">
</select>
Whenever the report type selected is bar graph or pie chart, it will not display the excel report view, else it will return all three report views.
reference: here
No comments:
Post a Comment