SAP Knowledge Base Article - Public

1893554 - How to pass a NULL value to a Crystal Reports optional parameter field using Visual Studio .NET

Symptom

  • If a parameter is not passed to the report the user is prompted for a value
  • Passing a NULL incorrectly in code results in the error: Type not compatible

Environment

  • SAP Crystal Reports, developer version for Microsoft Visual Studio
  • Microsoft Visual Studio (2010, 2012)

Resolution

  • VB
CrystalReport.ParameterFields("@B<parameter name>").CurrentValues.Clear()
CrystalReport.ParameterFields("@<parameter name>").CurrentValues.IsNoValue = True
  • C#
CrystalReport.ParameterFields["@B<parameter name>"].CurrentValues.Clear();
CrystalReport.ParameterFields["@<parameter name>"].CurrentValues.IsNoValue = true;

 

Keywords

cr crvs 2011 2012 param nothing empty , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio