on ‎2023 Aug 29 2:10 PM
Goodmorning,
I have an rpt with parameter fields, that are used in the report.
If I try to execute a print, without assigning values to some of that parameters at runtime (I'm using the Java SDK), I get this error:
com.crystaldecisions.sdk.occa.report.lib.ReportSDKParameterFieldException:
Some parameters have missing values---- Error code:-2147217394 Error code name:missingParameterValueError
I checked that in the SDK, working on the IParameterField object, I can access to:
Below the corrispondences in the designer of CR2020:

I finally noticed that I MUST assign one value to the currentValue of the parameter, to avoid the error, and for now I'm using those default values if they're present.
Now the question is:
Why doesn't Crystal automatically assign one between defaultValues and initialValues to the actualValues? It seems very strange...
I have also found two methods:
that I can call on the parameter passing 'true', but they don't work. For the first method in the doc. it says 'This is used only for stored SQL procedures.', the second instead seems to be the most appropriate one, but it doesn't solve the issue either.
This way would be the best, because I don't need to assign the default values, I only need to avoid the exception and allow null values on parameter fields.
So the other question is:
Is it possible to allow null values on parameter fields? If yes, how?
Thanks to everybody, any help would be appreciated.
Diego.
Request clarification before answering.
Often depending on the API used you may not be doing it the right way.
For example don use .ADD it could be you are trying to add the same Parameter name to the list of parameters.
Also, Java may be interpreting the value as a string...
Have a look at these Java samples:
https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports+Java++SDK+Samples
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried setting the "Optional Prompt" property to True?
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 7 | |
| 5 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.