arigakis Posted July 25, 2018 Share Posted July 25, 2018 Hello,I've created 2 date parameters (java.sql.Date) that I want the user to enter a start and end date. Then I want to conditionally highlight (or underline) a report field when a date falls within the parameters.Here is my conditional style expression: $F{date_summary_notes_created} >= $P{Start Date} The $F{date_occ_summary_notes_created} is a date field in the database.When I try to preview the report, I get the following error: "The operator >= is undefined for the argument type(s) java.sql.Date, java.sql.Date"What am I doing wrong? Link to comment Share on other sites More sharing options...
riodavid Posted July 26, 2018 Share Posted July 26, 2018 java.sql.Date is a java class. You can't compare directly. Use it's method compareTo() to compare.https://docs.oracle.com/javase/7/docs/api/java/sql/Date.html Link to comment Share on other sites More sharing options...
arigakis Posted July 26, 2018 Author Share Posted July 26, 2018 Thank you riodavid.I changed my expression to this:$F{date_occ_summary_notes_created}.compareTo($P{Start Date}) > 0but when I compile the report I get the error messeage:$P cannot be resolved to a variable.The report seems to run, but no condirional formatting is taken into effect.Angelo Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now