I have a JasperReports Server Custom Report Template, which I want to use when creating Reports from AdHoc views. Due to our requirements I've created a couple of Variables, to calculate previous Friday Date on that Template. It is written in Groovy. However, it fails when there are measures on the columns. After digging the Jasper Forum, I've found out that currently Crosstab AdHoc doesn't support Groovy expressions, and the only way is to convert my Groovy expression into Java, and that should sort the problem. Can anyone help me with the converting this expression into the Java expression ? Here is the Groovy one: ($V{Calendar}.set($V{Today}.getYear()+1900, $V{Today}.getMonth(), $V{Today}.getDate()) || $V{Calendar}.add(Calendar.DAY_OF_MONTH, IF ($V{Calendar}.get(Calendar.DAY_OF_WEEK)==Calendar.FRIDAY, -7, IF($V{Calendar}.get(Calendar.DAY_OF_WEEK)==Calendar.SATURDAY, -1, -7 + (Calendar.FRIDAY - $V{Calendar}.get(Calendar.DAY_OF_WEEK))))))? null : $V{Calendar}.getTime() As you can see I have created 3 variables, the Calendar, Today and a PreviousFridayDate. The last one is what I'm interesting in. The Calendar is set to java.util.Calendar and with an expression Calendar.getInstance() The Today variable is set to java.util.Date with an expression new Date() Can anyone help me with converting it into Java expression or maybe there are some more option on how to get it work ? Any help more than welcome. Thanks