samhast Posted July 1, 2013 Share Posted July 1, 2013 new net.sf.jasperreports.types.date.DateRangeBuilder("MONTH-1").toDateRange()Can I insert a parameter instead of a hardcoded MONTH -1?I tried with a string parameter:new net.sf.jasperreports.types.date.DateRangeBuilder($P{parameter1}).toDateRange()But that doesn't work.. Link to comment Share on other sites More sharing options...
marianol Posted July 1, 2013 Share Posted July 1, 2013 If you want to use a parameter, just need to define a DateRange Parameter directly, those can accept either dates or Relative Keywords (i.e. YEAR -1) see the attached Jasper Reposirory Export as an example. Link to comment Share on other sites More sharing options...
samhast Posted July 1, 2013 Author Share Posted July 1, 2013 How can I open that example in ireport? Link to comment Share on other sites More sharing options...
marianol Posted July 1, 2013 Share Posted July 1, 2013 To open it in iReport unzip the file and go to /resources/public/sandbox/Demos/DateDemo_files, and rename the file DateDemo_jrxml.data to DateDemo.jrxml, you will be able to open that report in iReport. I sent you the full jasperserver export because I also created the input controls for that report so it will be better if you import that to your jasperserver and then open the report from iReport connected to your server. Link to comment Share on other sites More sharing options...
vivek.suyampu Posted July 15, 2015 Share Posted July 15, 2015 Thanks for your example marianol, it helps me to create dynamic report with date parameters easily which I was trying for last 2 days, Thank you again Link to comment Share on other sites More sharing options...
steveo250k Posted July 27, 2015 Share Posted July 27, 2015 Thanks! This helped me too. Just what I was looking for. I wish, on the Jasper Server, it had the option to switch between the Relative Date and Calendar views (as in Ad Hoc reports). I can enter either a date or relative date to the field and either work. But, it's not intuitive to the user that they have both options. Link to comment Share on other sites More sharing options...
trinquet.christophe Posted March 17, 2016 Share Posted March 17, 2016 thank you very much it solved my problem in a minute!!! 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