tgustafson Posted April 26, 2017 Share Posted April 26, 2017 Good Morning,I'm new to Jaspersoft and trying to figure out how to return a specific date. I have a report that gets created letting customer know when our next meeting is. I need to return the 3rd Wednesday of December each year. Has anyone done something like this?Thanks,Terry Link to comment Share on other sites More sharing options...
hozawa Posted April 26, 2017 Share Posted April 26, 2017 This is just a Java question and not a JasperReports question.Anyways, enter something like below in your text field replacing "2017" with the year you wantjava.time.LocalDate.of(2017, 12, 1).with(java.time.temporal.TemporalAdjusters.nextOrSame(java.time.DayOfWeek.WEDNESDAY)).with(java.time.temporal.TemporalAdjusters.next(java.time.DayOfWeek.WEDNESDAY)).with(java.time.temporal.TemporalAdjusters.next(java.time.DayOfWeek.WEDNESDAY)) Link to comment Share on other sites More sharing options...
Siddharth Kothari Posted May 8, 2017 Share Posted May 8, 2017 If you are using Java 8 then you can import following classes in your report:java.time.DayOfWeek;java.time.LocalDate;java.time.Month;java.time.temporal.TemporalAdjusters;and use expression similar to below by replacing year with current year or any parameterLocalDate.of(2017, Month.DECEMBER, 10).with(TemporalAdjusters.dayOfWeekInMonth(3, DayOfWeek.WEDNESDAY)); 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