Jump to content
We've recently updated our Privacy Statement, available here ×

Dynamic timestamp parameter


pawankumar.singh
Go to solution Solved by pawankumar.singh,

Recommended Posts

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.

Thanks

Pawan

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 :D

if 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, lol

regards - TV

Link to comment
Share on other sites

  • Solution

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 book

3. 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.

Regards

Pawan

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...