I'm trying to generate a report using Crystal Report SDK in Java composed by a main report and a subreport.
I do want to generate the report only if there is something returns by my stored procedure and for doing that I execute the proc manually and launch the report generation only if my ResultSet != null.
But, my subreport has to be generated through Crystal.
- I use the setTablesDatasource() method for my main report for using my ResultSet
- For my subreport:
_ I use the setTableslocation() for getting the values and generating the report through crystal
_ I set all the parameters needed in the ParameterFieldController of my subreport.
However, I'm getting this error in my console :
Missing parameter values.---- Error code:-2147217394 Error code name:missingParameterValueError
Even though the subreport's parameters are correctly setted.
If I generate my report with no subreport or with report and no needed parameter, the generation is just fine.
Am I setting my parameters in a wrong way ?
After trying a lot of stuff for integrating my subreport without using another ResultSet, here is the way for setting the parameters for the subreport :
You have to use the ParameterFieldController of the main report and not the one of the subreport... Logic.
And now, it works just fine !