Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

JRC CR XI Rel 2 - Invalid Parameter Name: {0} using Stored Proc in Oracle

Hello,

I've been stumped by this issue that I've been getting. I've been trying to take advantage of stored procs to filter the result set before returning to CR instead of using views, which relies on most of its filtering on the crystal reports side.

I've followed the process of creating the strongly bound cursor, then including an "in out" parameter along with 5 other "in" parameters in the stored proc. In the Java class, this is how I pass in the parameters:

        ReportClientDocument reportClientDoc = new ReportClientDocument();
        reportClientDoc.open(REPORT_NAME, 0);
        //Connection setup
        ConnectionService.getInstance().crytalReportsConnectionSetup(reportClientDoc.getDatabaseController());
        //We will be using the ParameterFieldController
        ParameterFieldController paramFieldController = reportClientDoc.getDataDefController().getParameterFieldController();
        paramFieldController.setCurrentValue("", "PARAM1", "000");
        paramFieldController.setCurrentValue("", "PARAM2", "000");
        paramFieldController.setCurrentValue("", "PARAM3", "000");
        paramFieldController.setCurrentValue("", "PARAM4", "000");
        paramFieldController.setCurrentValue("", "PARAM5", "000");

I end up getting an error:

Invalid Parameter Name:

I've tested the report itself in Crystal and it works. Is there something I'm missing?

Thanks in advance,

Jeff

Former Member
Former Member replied

Whether or how you wrap your parameters depends on what the type is in Crystal Reports. If it is indeed a number, something that works well is to create a number object (for example new Integer("2")) and pass it to the parameter.

The error you are experiencing however seems to be related to the parameter name; can you confirm that the names you are using exactly match the case, and everything, in Crystal Reports? For a stored procedure you may need to pre-pend the @ symbol to your parameter name.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question