Skip to Content
0
Aug 29, 2023 at 01:10 PM

Crystal Reports 2020 Runtime Java - Error parameter values missing

282 Views Last edit Aug 29, 2023 at 03:28 PM 5 rev

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:

  • initialValues
  • defaultValues
  • currentValues

Below the corrispondences in the designer of CR2020:

x-domanda-sap.jpg

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:

  1. setAllowNullValues(boolean)
  2. setIsOptionalPrompt(boolean)

    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.

    Attachments

    x-domanda-sap.jpg (80.1 kB)