Modify Reporting Execution #166 

- Move JSP functions from page to functions.jsp
- Add functions to generate where clause from parameters.
- Correct SQL generations to retrieve values.