Adding date picker as parameter in BIRT

后端 未结 1 540
闹比i
闹比i 2020-12-21 18:45

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

1条回答
  •  礼貌的吻别
    2020-12-21 19:33

    There is a way to achieve this, but it is not straight forward.

    Here is how,

    1. 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

    2. 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.)

    3. 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.

    
    
    
    

    1. 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

    2. Find "TextBoxParameterFragment.jsp" file located in

      "birt/webcontent/birt/pages/parameter/TextBoxParameterFragment.jsp"

    3. 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) {
    %>
    
    
    
    
    
    <%
    }
    %>
     ``
    ``

    1. 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.

    0 讨论(0)
提交回复
热议问题