Dynamic timestamp parameter

0

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

pawankumar.singh's picture
Joined: Sep 19 2018 - 10:39pm
Last seen: 1 day 13 hours ago

2 Answers:

0

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

pawankumar.singh's picture
Joined: Sep 19 2018 - 10:39pm
Last seen: 1 day 13 hours ago
0

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

trvpseudo's picture
Joined: Jan 30 2019 - 11:02pm
Last seen: 7 hours 24 min ago
Feedback
randomness