my report consist two parameters like particular day filter and date range filter .i want to show report like this.if user click on particular day it shows only particular day filter only in other case if user select date range radio button it have to show only date range filter only. is there any way to like this please provide the answer if any one of you knows .
1
votes
1 Answers
0
votes
Well, assuming you are designing your report in Pentaho Report Designer (PRD):
- Set the parameters for your report, including radio button parameters or any other interface elements.
All the parameters must be shown all time, because by default, you can't hide the visibility of the parameter filters on the fly (as long as I have been using it), but you can play with the parameter results on the fly. To apply a filter just restrict your SQL query, could be something like:
SELECT A
FROM TABLE
WHERE (${radiobutton} = FALSE AND DAY(A) = ${startDay})
OR (${radiobutton} = TRUE AND DAY(A) BETWEEN ${startDay} AND ${endDay})
The "OR" codition will help you to get the result from one of the 2 cases. The "AND" condition will help you to verify in wich case you are, if date range, or specific date.
Hope it helps.