zhuolin Posted June 5, 2011 Share Posted June 5, 2011 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 More sharing options...
middiu Posted June 6, 2011 Share Posted June 6, 2011 If you parameters aren't mandatory you can schedule report with null values, so you can decode null value in report SQL for example. Link to comment Share on other sites More sharing options...
zhuolin Posted June 6, 2011 Author Share Posted June 6, 2011 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 More sharing options...
mdahlman Posted June 7, 2011 Share Posted June 7, 2011 There is no nice simple solution to this. You could use something along the following lines. Create these input controls:LastWeek (boolean checkbox)StartDateEndDateStartDateSQLEndDateSQLStartDate 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 More sharing options...
zhuolin Posted June 7, 2011 Author Share Posted June 7, 2011 thanks to your suggestion. that would fit my situation.Is it possbile to suggest jasperserver support for default value in schedule reporting? 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