rdp9090 Posted June 20, 2017 Share Posted June 20, 2017 My report currently generates a stacked bar graph, where it lists every project in the database (each associated with a project_type), and the bars represent the number of tasks for the project in each status (To Verify, To Do, In Progress). I would like to add a function for users in Jasperreports Server to filter which projects they want to see using a checkbox or list to select the project_type for which they want to see data for. I tried using a multi select query input control as I searched online, but the examples used simpler queries and I was unable to apply the same concept to my own report. My query for the report currently looks likeSELECT PROJECT_TYPE.PROJECT_TYPE_NAME, PROJECT.PROJECT_NAME, STATUS_TYPE.STATUS_TYPE_NAME,COUNT(*) AS TasksFROM TASKINNER JOIN PROJECT ON PROJECT.PROJECT_ID = TASK.PROJECT_IDAND PROJECT.POURCENTAGE < 100AND PROJECT.PROJECT_TYPE < 6AND PROJECT.PROJECT_STATUS_ID < 3INNER JOIN PROJECT_TYPE ON PROJECT.PROJECT_TYPE = PROJECT_TYPE.PROJECT_TYPE_IDINNER JOIN STATUS_TYPE ON TASK.STATUS_TYPE_ID = STATUS_TYPE.STATUS_TYPE_IDINNER JOIN PRIORITY_TYPE ON TASK.PRIORITY_TYPE_ID = PRIORITY_TYPE.PRIORITY_TYPE_IDAND NOT PRIORITY_TYPE.PRIORITY_TYPE_NAME = 'Hold'AND STATUS_TYPE.STATUS_TYPE_NAME IN ('To do','In Progress', 'To Verify')GROUP BY PROJECT_TYPE.PROJECT_TYPE_NAME, PROJECT.PROJECT_NAME, STATUS_TYPE.STATUS_TYPE_NAMEorder by 2, case status_type_name when 'To do' then 1 when 'In Progress' then 2 when 'To Verify' then 3 else 4 endHow should the query for the input control and the parameter be set up in this case? Link to comment Share on other sites More sharing options...
elizam Posted June 20, 2017 Share Posted June 20, 2017 What did you try to do for an input control? I don't think the complexity of the query affects how you set up the input control. You just want a simple filter on the PROJECT_TYPE_NAME field. The query controls which data is displayed, and the input control functions within the confines of that data. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now