I am having some challenges adding a date picker for my date parameter in an Eclipse report. I have little or no knowledge of Javascript ... I would appreciate some detailed
There is a way to achieve this, but it is not straight forward.
Here is how,
First you need to download the jscal2 project files.You will find the required files in the below mentioned Github project.
https://github.com/captainhcg/GFW/tree/master/js/JSCal2-1.9
In your project find "FramesetFragment.jsp" file located in the location
birt/webcontent/birt/pages/layout/FramesetFragment.jsp
This file should be readily available in your current project setup, if you already have birt report up and running. (I am not going to explain birt report configuration in a JAVAEE web project here, because this is only about how to add the datepicker for existing birt report date parameter field.)
Add the following lines of code after line number 130(before the tag) of "FramesetFragment.jsp" file. Replace the context root path with your
project context root.
Add the relevant files(4 files) into specified locations in your project
4.1 Add both jscal2.js and en.js files into javascript file location in your project.
yourwebcontextroot/js/jscal2.js
yourwebcontextroot/js/lang/en.js
(* At least one language file is required)
4.2 Add both style sheets to relevant locations.
yourwebcontextroot/css/border-radius.css
yourwebcontextroot/css/jscal2.css
Find "TextBoxParameterFragment.jsp" file located in
"birt/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp"
Add the following code just before the last table data and table row end tags of "TextBoxParameterFragment.jsp" file.
<%
if (parameterBean.getParameter().getDataType()==7|| parameterBean.getParameter().getDataType()==4) {
%>
<%
}
%>
``
``
Thats all. Redeploy your project.Open a new browser window and go to one of your reports.
You should see a button next to date fields and once you clicked on it, you will get a datepicker window.
Note:
Both "FramesetFragment.jsp" and "TextBoxParameterFragment.jsp" files could be in different locations in your project.