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

schedule report with dynamic inputs


zhuolin

Recommended Posts

Hi All,

Not sure if this was asked before, but I could not get anything from keyword search on this topic.

 

I have a report run on occassion basis and it has two dynamic inputs - today's date and six days before. They are all mandatory fields and set with default values and works perfectly on every clicks.

I am now going to have a scheduling report job on it but when i was at the step of setting input parameters, I could not find a way to pass by dynamic dates. I tried leave blank but server not allows that because it is mandatory fields. I also made couple tries with mandatory flag removed. But I found the report would take empty value as inputs if I leave blank in the schedule settings.

I can solve this problem by creating a same report with no input controls for scheduling but I am interested that is there a way of doing those thing in one report

 

Cheers,

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

if the parameters are visible in general report execution, then there are avaliable input options for those parameters when set schedule reporting.

If I leave blank, when the schedule reporting actived, it will  take blank as parameter input, not a null value which I am after. But I need those parameter input be visible as the report is running on occasion basis as well.

Is there any option for schedule report to use default value of any parameters?

Link to comment
Share on other sites

There is no nice simple solution to this. You could use something along the following lines. Create these input controls:

LastWeek (boolean checkbox)
StartDate
EndDate
StartDateSQL
EndDateSQL

StartDate and EndDate are simple dates. But for StartDateSQL you use logic like this:

If LastWeek is checked then use the date 6 days before today (and ignore StartDate), but if LastWeek is not checked then use StartDate. Use the ternary operator and fill in the relevant date calculation:

$P{LastWeek} ? [calculate today - 6 days] : $P{StartDate}

There are lots of variations on this idea. But something like this should give you what you need.

Regards,
Matt

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