Jump to content

Use of many instructions inside a variable


dboutin

Recommended Posts

Hi,

Is it possible to use a script as this one inside a variable of iReport ?

 

java.util.Calendar calendar =

new java.util.GregorianCalendar();
calendar.setTime(
new java.util.Date($F(My_Date)));
calendar.get(java.util.Calendar.YEAR); Regards,

 

Denis.
 

 

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

yes, as long as make it in one line :)
make it easier on yourself to get the date from your DB as Date (field)
(new java.util.GregorianCalendar().setTime($F{date}).get(java.util.Calendar.YEAR)

perhaps you can make multiple variables to make it easier OR

try to use the SQL functions of your db... for example, i use the WEEK() function of MySQL:
select WEEK(customer.dob) as weeknumber_dob from customer



Post Edited by sjongenelen at 11/17/2009 15:29
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...