Posted: 25 Mar 2021 4:19 EDT Last activity: 29 Mar 2021 12:37 EDT
Report Definition Parameter Default Value Ignored
v7.3.1, WAS 8.5.5, Oracle 11g
We have a report definition which queries our work table joined with index table and has other criteria's to filter the results. And the RD is called from an activity using pxRetrieveReportData and all parameters required are passed from the activity. One of the criteria value in the RD is sourced using a parameter and if this param is blank, it ignores the criteria (not using null if blank).
In the Parameter tab of the RD - we set a default value for this param to a value that doesn't exist so no records would be brought if the param has no value (instead of ignoring the criteria). When the RD is run on its own, this default value is applied but when run using the activity, this default value is not applied.
Is this the expected behavior for parameter default value in RD or has anyone come across this issue?
We have other options to make our functional requirement work for our scenario but just wanted to understand the "Default value" behavior for a RD param in this case
While calling the report definition from the activity you might be passing current page parameters (check box true).
I guess this is expected because while sending params from an activity even "" is considered as a value. You would need to handle this properly. (Also, setting the default value in activity param would help)
Add a check for this param in the activity before passing it to the RD.
@Hoyath Thank you for your response. We have handled that now in a similar way to ensure all required data is available before we call the RD.
Was just curious as to what other purpose the default value then serves i.e. I do see that the default value gets picked up when the RD is run manually. But in most other situations the RD is going to be embedded within another rule type to be invoked and looks like the default value will get ignored based on what you have mentioned above.
I guess, the default value gets picked up when the supposed parameter is completely missing on the parameter page. I.e. even if the parameter exists with a "" value in the parameter page which is being passed to RD then it's expected to pick that value.
There might be circumstances where you might actually need to send a "" value as a parameter if the default value works the way you expected then this requirement cannot be achieved.