Share via


ParameterField Class

Provides properties for retrieving and setting options and values for a parameter field.

Namespace CrystalDecisions.Shared Assembly CrystalDecisions.Shared (CrystalDecisions.Shared.dll)

Syntax

'Declaration
Public Class ParameterField
    Implements ICloneable, IParameterField
public class ParameterField : ICloneable, IParameterField

Example

This example shows how to add a parameter field to a report.

'Declaration

          Private Function AddParameter(ByVal paramName As String, _
          ByVal paramValue As String, ByVal paramFields As ParameterFields) As ParameterFields
          Dim paramField As New ParameterField
          Dim paramValues As New ParameterValues
          paramField.AllowCustomValues = True
          paramField.CurrentValues = paramValues
          paramField.DefaultValueDisplayType = DefaultValueDisplayType.DescriptionAndValue
          paramField.DefaultValues.Add(paramValue)
          paramField.EditMask = "----"
          paramField.EnableAllowMultipleValue = True
          paramField.EnableNullValue = False
          paramField.HasCurrentValue = False
          paramField.Name = "New Parameter"
          paramField.ParameterValueType = ParameterValueKind.StringParameter
          paramField.PromptingType = DiscreteOrRangeKind.RangeValue
          paramField.PromptText = "Enter:"
          paramField.ReportName = "New Report"
          paramField.ReportParameterType = ParameterType.ReportParameter
          paramFields.Add(paramField)
          AddParameter = paramFields
          End Function
        
          private ParameterFields AddParameter(string paramName,
          string paramValue, ParameterFields paramFields)
          {
          ParameterField paramField = new ParameterField();
          ParameterValues paramValues = new ParameterValues();
          paramField.AllowCustomValues = true;
          paramField.CurrentValues = paramValues;
          paramField.DefaultValueDisplayType = DefaultValueDisplayType.DescriptionAndValue;
          paramField.DefaultValues.Add(paramValue);
          paramField.EditMask = "----";
          paramField.EnableAllowMultipleValue = true;
          paramField.EnableNullValue = false;
          paramField.HasCurrentValue = false;
          paramField.Name = "New Parameter";
          paramField.ParameterValueType = ParameterValueKind.StringParameter;
          paramField.PromptingType = DiscreteOrRangeKind.RangeValue;
          paramField.PromptText = "Enter:";
          paramField.ReportName = "New Report";
          paramField.ReportParameterType = ParameterType.ReportParameter;
          paramFields.Add(paramField);
          return paramFields;
          }
        

Inheritance Hierarchy

Object
   ParameterField

Version Information

Crystal Reports Basic for Visual Studio 2008

Supported since: Crystal Reports for Visual Studio .NET 2002

See Also

Reference

ParameterField Members
CrystalDecisions.Shared Namespace