Skip to Content
0
Former Member
Jan 04, 2011 at 01:43 PM

How to disable "Enter Parameter Values" for optional paramters?

59 Views

I'm having issues getting the Crystal Reports .NET Viewer to suppress the "Enter Parameter Values" dialog for optional parameters. I have templates created using Crystal Reports 2008 and am linking against the CR for VS 2010 runtime.

Within the report template the optional paramter has "Optional Prompt" set to "True". This particular parameter also allows multiple values and is used in record selection. Within the record selection it is using HasValue().

It seems the parameter is set up properly as I have other parameters that are set within the code that are not prompted for. If I pass in the optional parameter through the code the "Enter Paramater Values" dialog also does not appear and the report is generated correctly. All of the parameters are set using ParameterFields and they are set before the ReportSource is set.

Looking through the .NET API documentation it seems like the CrystalReportViewer should have an "EnableParameterPrompt" property that would do what I want however it doesn't seem to be a valid parameter as I get compile errors when I try to use it... Not sure if it matters or not but I am using managed C++ and our application is built using Visual Studio 2005. Could that maybe have something to do with it?

Thanks,

-Ben