How to Disable/Restrict Futures Dates, While using Date as Input Control..

 Hi Everyone,

 [NOTE: I am using Jasper Server 7.9.0, For Report Designing using TIBCO Jaspersoft Studio Professional (TIB_js-jss_7.9.0)].
   
         I have created a Standard Report which displays the report by filtering data within a selected period range. where the two Input Parameters are StartDate and EndDate. Here the problem is calendar is showing Future Dates too which I want to Restrict/Disable. 

For the following criteria I want to Restrict/Disable the Dates in Calendar.

1. The Max Date that the user can select is Current Date. All the dates greater than Current Date should be Restricted/Disabled.

2. If User select StartDate as May 5th 2023. when he wants to select EndDate then the Dates Before May 5th 2023 should be Restricted/Disabled.

3. If User selects StartDate greater the EndDate have to show Error Message. 

If Restriction/Disabling is not possible, Can we validate the input control to pop up an Error Immediately. If we can please let me know the procedure in Detail.

Thanks in Advance for all the Advices and Answers.

ibrahimkhalilulah.md's picture
Joined: May 7 2023 - 11:16pm
Last seen: 1 week 3 days ago

Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.

arai_4 - 4 months 2 weeks ago

Thank you for your patience, we need a little more time with our team of experts to come up with a solution. We will respond back as soon as we have an answer to your question.

arai_4 - 4 months 6 days ago

Hi ibrahimkhalilulah.md,

I think there is no out of the box solution to validate/restrict the Future dates.

However, you might be able to add the validations on a custom jsp and import the same to Controls & Resources tab.
But please note that this will work only in the report input controls and not on the scheduler page.

prparame - 3 months 3 weeks ago

2 Answers:

Hi ibrahimkhalilulah.md,

I think there is no out of the box solution to validate/restrict the Future dates.

However, you might be able to add the validations on a custom jsp and import the same to Controls & Resources tab.
But please note that this will work only in the report input controls and not on the scheduler page.

Attachments: 
AttachmentSize
Image icon customjsp.jpg122.01 KB
prparame's picture
Joined: Feb 9 2023 - 7:45am
Last seen: 7 hours 20 min ago

  I would like to appreciate to your answer, As you mentioned I had created a JSP file with my custom date validation and tested the code in Non-jasper Environment and it passed all the check points as required. then I have placed the JSP file in the following directory (WEB-INF/jsp/modules/inputControls ) and placed the directory path in Optional JSP Location then restarted the JasperServer and tried to run the report.

Now I am getting the following error. I have attached the Error log file below.

Kindly assist to fix the following error. Thanks in Advance for all the Advices and Answers.

Error Message after running the report

image

Attachments: 
ibrahimkhalilulah.md's picture
Joined: May 7 2023 - 11:16pm
Last seen: 1 week 3 days ago
Feedback