Combining a date parameter and a list box value parameter
Hello All,<br />
<br />
I'm hitting a brick wall. I'm currently using BIRT version 2.2.0<br />
<br />
<span class='bbc_underline'>What I'm trying to do:</span><br />
I would like to allow user run a report that will provide n month(s) worth of data, based on an end date and going back 'n' months. For example, if a user enter 28-Feb-2010 and choose 2 months, then report would generated data from 01-Jan-2010 up to 28-Feb-2010.<br />
<br />
<span class='bbc_underline'>What I've done</span><br />
Here's what the sql script is doing:<br />
start date >= to_date((concat(to_char(add_months(to_date(?,'yyyy-mm-dd'),?),'yyyy/mm'),'01')) || ' 00:00:00', 'yyyy-mm-dd hh24:mi:ss')<br />
<br />
end date <= to_date(concat(?,' 23:59:59'), 'yyyy-mm-dd hh24:mi:ss')<br />
<br />
<br />
I've created 3 dataset parameters:<br />
1. StartDate (type: date, linked to report parameter:EndDate)<br />
2. MonthPeriod (type:Integer, linked to report parameter: Number of Month)<br />
3. EndDate (type: date, linked to report parameter: EndDate)<br />
<br />
I've also created 2 report parameters:<br />
1. EndDate (display type: text box, data type: date, default value: 2010-02-28)<br />
2. Number of Month (display type: list box, data type:integer) which has the following list of static value:<br />
Value, Display Text<br />
0, 1 month<br />
-5, 6 months<br />
-11, 12 months<br />
<br />
<span class='bbc_underline'>Problem</span>:<br />
I can't get parameters working together. It will work if I can assigned a fixed value for 'n' months directly in sql while having user to enter the end date, or the other way around. But, couldn't get both parameters entered by user.<br />
<br />
<strong class='bbc'>what am i missing?</strong><br />
<br />
Help is much appreciated.<br />
<br />
Thanks,<br />
Albert