pawankumar.singh Posted December 3, 2019 Share Posted December 3, 2019 Hi Folks,we want to pass the dynamic timestamp in jasper reports like from $P{today}-Month/Weeks/Days in our oracle queries in jasper studio. currently, we are using static parameters in our query but now we want to schedule the reports and need to pass dynamic dates in reports. can anyone assist us for the same.Help is appreciated and Thanks in Advance.ThanksPawan Link to comment Share on other sites More sharing options...
trvpseudo Posted December 4, 2019 Share Posted December 4, 2019 hi hi~i hv something similar,but in jasper scheduler, u cant put dynamic value (as far as i hv explore, i might be wrong)if the date is repetitive like 'today' then u can set the query always today!in my case :"... case when $P{SELECTED_DATE} is null then sysdate-1 else ${SELECTED_DATE} end ...."so if the user intend to use the sceduler, itll always get the day-before data :Dif u want something more complicated but prolly dynamic, put the input date in a table say table A, then use batch or something to update the date.the report query then will select the date in the table A.note : havent tried but was my last idea at that time, lolregards - TV Link to comment Share on other sites More sharing options...
Solution pawankumar.singh Posted December 4, 2019 Author Solution Share Posted December 4, 2019 Thanks, Man,I resolved the issue by using report book.What I have done is:1. Create the Abstract Book Report 2. Call the main report in which i need to put the dynamic value in Abstract book3. Run the query a simple query like (select add_months(current_timestamp,-1) as date_time from dual;) that return a date (today date subtract 1 month) that vlaue stores in the field.4. And then just pass that value in Subreport as static parameter in $P{Today} and get the result.RegardsPawan 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