0
votes

How can i validate date parameters in a pentaho report designer.I am using "fromDate" and "ToDate " parameters in my report/prpt.Because if i am selecting particular date range i will get that particular date ranging values only..It is working fine... But if anyone is selecting date range like " FromDate > ToDate " i want to show some notifications like " wrong date selection " like dat..

Is it possible in Pentaho Report Designer? Or by using some java SCript?

2

2 Answers

0
votes

Can you provide more context? I don't seem to understand your question.

But try to use the IF formula to your parameter (since I believe you are using it as a field in your report) to render the value to be "Wrong date selection" if the start date is greater than the end date or vice-versa.

0
votes

In a Pentaho report designer, take a label for validation and edit a value in the attribute tab as -

=IF([FromDate ]>[ToDate];"'ToDate' should be greater than or equal to 'FromDate '";
IF([FromDate ]>TODAY();"'FromDate ' should be less than or equal to 'current date'";""))

Hope this answer helps.

screenshot