Question How to suppress 'Enter Parameter Values' dialog box?

RNathan

Member
Joined
Mar 9, 2012
Messages
6
Location
Landover, MD
Programming Experience
10+
Hi,

I am having issues supperessing 'Enter Parameter Values' dialog box. I am following the suggestions given in various blogs and I am still having difficulties getting this dialog box suppressed. I am using VB.Net VS 2010 Premium. Crystal Reports 2011 (Ver 14.0.2). My OS is Win 7.

In one of my reports, I am using a parameter called "SortBy" and this paremeter is accessed in one of the Formula Fields called "SortField" as follows:

switch( {?SortBy} = 'Sorted By Job Name', {report.JOBNAME},
{?SortBy} = 'Sorted By Banner', {report.BANNERNAME},
{?SortBy} = 'Sorted By Recipient', {requestor.LASTNAME},
True, {report.JOBNAME})

In my vb.net program, I am allowing my users to select which field they want to sort the report on. It could be either JobName or Banner or Lastname. This sort selection passed to the report as it is in the following code:

Dim PrmFields As New ParameterFields
Dim PrmField As New ParameterField
Dim DiscreteVal As New ParameterDiscreteValue
PrmField.ParameterFieldName = "@SortBy"
DiscreteVal.Value = lsSortBy 'Either by JobName or Banner or LastName
PrmField.CurrentValues.Add(DiscreteVal)
PrmFields.Add(PrmField)
ReportViewer.ReportSource = ReportDistRpt
ReportViewer.ParameterFieldInfo = PrmFields
ReportViewer.ReuseParameterValuesOnRefresh = False

The dialog box still appears with this code. Any help would be greatly appreciated....

Thanks,

rmn
 
Back
Top