Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Data set parameter with list box
stade13
Hello,
I am contacting you because I have a problem with my dataset parameter. What I want to do is for each execution of the report I display a list box to select the current month or the previous one month. For that I created a data set select * from mytable Where MONTH (myDate) = ? and I specified ChoiceMonth in Report Parameters. ChoiceMonth is a Button radio but the values ??are static, I also tried a dynamic list box but I do not know how I do for the current month and months pr?cedent .
Thank you for your help.
Find more posts tagged with
Comments
kclark
Are you trying to get the current month and the previous month? Or this current month and all the months prior? You can create a customer parameter page with a function that gets the current month and the last, then change the parameter drop down to show these as the only two choices.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/birt.tld" prefix="birt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script>
function getMonths() {
var d=new Date();
var month=new Array();
month[0]="January";
month[1]="February";
month[2]="March";
month[3]="April";
month[4]="May";
month[5]="June";
month[6]="July";
month[7]="August";
month[8]="September";
month[9]="October";
month[10]="November";
month[11]="December";
var currentMonth = month[d.getMonth()];
var lastMonth = month[(d.getMonth() - 1)]
var box = document.getElementById("7");
var month1 = new Option(currentMonth, currentMonth);
var month2 = new Option(lastMonth, lastMonth);
box.options[box.length] = month1;
box.options[box.length] = month2;
}
</script>
<body onLoad="getMonths();">
<birt:parameterPage
id="report1"
name="page1"
reportDesign="test.rptdesign"
isCustom="true"
pattern="frameset">
Select Month: <birt:paramDef id="7" name="Month"/>
</birt:parameterPage>
</body>
</html>
</pre>