Jump to content
JasperReports Library 7.0 is now available ×

Comparing a date to a parameter for a conditional format


arigakis

Recommended Posts

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

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Thank you riodavid.

I changed my expression to this:

$F{date_occ_summary_notes_created}.compareTo($P{Start Date}) > 0

but 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...