Search code examples
t-sqlcrystal-reportsparameter-passingcrystal-reports-xi

application assigns value to parameter in stored procedure, used in Crystal Report


I have a custom application that has an embedded Crystal Reports viewer. The RPT file in question calls a stored procedure. The stored procedure has a parameter, "UserID".

I want to configure the report so it can recieve a value for UserID from the application.

Right now, when I preview the report in CR11.5, it prompts me to enter a value for UserID. instead, I would like the custom application to do this for me so the Enter Values box does not appear when the report is run.


Solution

  • Very simple solution. If the application is already rigged to pass a value to a specific parameter, all you have to do is create a parameter in the RPT file and give it the same name:

    1. right-click Parameter Fields in the Field Explorer
    2. new
    3. name the parameter
    4. click ok
    5. the report should now run as you need it to in the test environment.