I am getting "Missing Parameter Values" error when i try to launch a report from a java program.
This report has some optional parameters, but i don't know how to set that parameter to null.
I try this:
clientDoc.getDataDefController().getParameterFieldController().setCurrentValue(reportName, parameterName , "");:
It's works, but the HasValue() function don't work with empty String.
clientDoc.getDataDefController().getParameterFieldController().setCurrentValue(reportName, parameterName , null);:
The method fails with a NullPointerException
Avoid to call setCurrentValue method when the parameter has no value. Then i getting the "Missing Parameter Values" error
Searching for a solution, i find this (in ..NET SDK)
[Missing Parameter Values CR2008 Optional Parameter;
This issue has been resolved in Service Pack 2 for Crystal Reports 2008. There are special notes to be aware of from the release notes.
ADAPT01130451
Description:
The error message "missing parameter values error" appears when Crystal reports that use optional parameters are exported using the .NET SDK.
New Behavior:
This problem is resolved.
To solve the problem, before exporting the report, users must set the value of optional parameters to true as follows:
boReportDocument.ParameterFields["Customer ID"].CurrentValues.IsNoValue = true;
Is this bug present in the Java SDK too? How i need to prepare the parameter value when it's options?
Thanks a lot