my.nguyen Posted November 17, 2016 Share Posted November 17, 2016 Hello, i am newbee so please help with my stupid question!Postgsql DB, field name: CreateDate (TimeStamp)I created report in jasperSoft Studio have a fieldname CreateDate.How can I set the value for the field CareteDate=2015 only in the report?I tried in express Editor: Integer.valueOf(2015).equals($F{createdate}) : it's not working right :(Please advise, Thank you.MN Link to comment Share on other sites More sharing options...
reportdev Posted November 17, 2016 Share Posted November 17, 2016 do you want to filter out the report based on year 2015 ? ordo you want to populate 2015 in the report ? Link to comment Share on other sites More sharing options...
my.nguyen Posted November 17, 2016 Author Share Posted November 17, 2016 Thank for review.I want to see both. How can I do that?Thank you.MN Link to comment Share on other sites More sharing options...
Balraj Posted November 18, 2016 Share Posted November 18, 2016 If you want to display/fetch only YEAR from CreatedDate then:In TextField Expression give it as: YEAR(CreatedDate), this will return you year from passed date.To get only 2015, then new Integer(YEAR(CreatedDate))==2015.To filter data, you can update the query to return data of 2015 year.Best Regards,JasperExplorer Link to comment Share on other sites More sharing options...
my.nguyen Posted November 18, 2016 Author Share Posted November 18, 2016 Wow ... That working perfect :)Than you JasperExplore! Link to comment Share on other sites More sharing options...
Balraj Posted November 22, 2016 Share Posted November 22, 2016 Glad that it worked for you. Accept it as answer,It'll be helpful for othersBest Regards,JasperExplorer 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