1202315 - How do I get a parameters default value's description via the NET SDK?

SAP Knowledge Base Article - Public

1202315 - How do I get a parameters default value's description via the NET SDK?

Symptom

When pulling out the default parameter values from a parameter using the .NET SDK, how do you get the description associated with it?

Cause

 

Resolution

The following code pulls the value and the description from the first parameter's first default value:
 
VB.NET
------------------------------------------------------------------------------
imports CrystalDecisions.CrystalReports.Engine
imports CrystalDecisions.Shared
Dim crRpt as new CrystalReport1
Dim ParamFieldDefs as ParameterFieldDefinitions
Dim ParamFieldDef as ParameterFieldDefinition
Dim ParamDiscreteValue as ParameterDiscreteValue
ParamFieldDefs = crRpt.DataDefinition.ParameterFields
ParamFieldDef = ParamFieldDefs.Item(0)
ParamDiscreteValue = ParamFieldDef.DefaultValues.Item(0) Dim value as string = ParamDiscreteValue.Value
Dim desc as string = ParamDiscreteValue.Description

Keywords

NET description parameter default value XI R2 Release 2 , 6086916 , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio ; SAP Crystal Reports, version for Visual Studio .NET 2008