SAP Knowledge Base Article - Public

1603803 - The DefaultValues.Remove(), RemoteAt() and RemoveRange() do not remove values from the collection in the Crystal Reports .NET SDK

Symptom

  • Using the Crystal Reports .NET SDK to remove items from the ParameterField.CurrentValues or ParameterField.DefaultValues collections.
  • Using the Remove(), RemoveAt() or RemoveRange() methods.
  • These Remove methods don't remove items from the values collection. No error is thrown.

Environment

  • Windows OS
  • Visual Studio .NET 2005
  • Crystal Reports XI R2 SP6, FP 6.4
  • Crystal Reports 2008
  • Crystal Reports for Visual Studio 2010, SP1

Reproducing the Issue

string parameterName = "parameter name1";
boReportDocument.ParameterFields[parameterName].DefaultValues.Remove(0);  // Remove the first default value in the index.

Cause

The issue has been identified and logged under Problem Report ID ADAPT00542198.

Resolution

  • There is currently no service pack or fixpack available to fix the functionality of Remove(), RemoveAt() or RemoveRange().
  • To work around the problem you can use the ParameterValues.Clear() method to remove all the items from the collection, then rebuild it omitting the values you wanted to remove.

Keywords

KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Bug Filed

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports XI R2 ; SAP Crystal Reports, developer version for Microsoft Visual Studio