purplepride1961 Posted January 27, 2022 Share Posted January 27, 2022 HelloI'm a newbit to iReports. I'm using version 5.6.0I have a need to compare a string field that has dates (in MM/DD/YY format, like 01/09/2020 or a value of 'Missing' , look at the date and see if its more than 6 days old (from today, or the report date), and if so, change thefont on the field. For now, i'm actually just comparing the date to todays date and if its before today, to change the font. If I can get it to work , then I'll add the criteria to look back 6 days.My thought was to create 2 variables. The first is called TEMP1, and is set as java.util.date using the variable expression below. I'm basically setting the character string 'Missing' to a dummy date, otherwise just use the date.$F{Scheduled Home Delivery}.trim().equals("Missing")? ("12/31/2049") : $F{Scheduled Home Delivery}My second variable is just called RptDt, is set as java.util.date and has the variable expresssion: Its meant to contain todays datenew SimpleDateFormat("MM/DD/yyyy").format(new Date())But I am getting this error: Error processing report - Error evaluating expression for source text: $V{tempSchdHomeDelvDt}.before $V{RptDt}I am using the following logic to help set a style for a field:$V{tempSchdHomeDelvDt}.before $V{RptDt}Any suggestions?Thank you. Link to comment Share on other sites More sharing options...
purplepride1961 Posted February 8, 2022 Author Share Posted February 8, 2022 So, I couldn't get any date calculations to work, so I went and performed the them within the query that creates the date file used, and used that field in my logic instead. Link to comment Share on other sites More sharing options...
purplepride1961 Posted February 8, 2022 Author Share Posted February 8, 2022 So, I couldn't get any date calculations to work, so I went and performed the them within the query that creates the date file used, and used that field in my logic instead. 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