title: Crystal Reports Custom IsNull Function
body: <p>I am trying to create a custom IsNull Function in Crystal Reports; the function must act the same way as the IsNull Function in MS SQL Server. I want to specify a field, and if the field is null, then it must be returned with a value I have specified.</p>
  
  <pre><code>IsNull({myField},0) or
  IsNull({myField},'Hello World') 
  </code></pre>
  
  <p>I have encountered that I have to create a separate function for number fields and a separate function for text fields. I also found that Crystal does not allow the use of standard functions inside of a custom function, for instance the <code>ISNULL</code> Function:</p>
  
  <pre><code>Function(NumberVar param, Numbervar setter)
  IF ISNULL(param) THEN setter ELSE param
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Function(StringVar param, StringVar setter)
  IF param = NULL THEN setter ELSE param
  </code></pre>
  
  <p>Does anyone know how I can create a function like this in Crystal and a work around for the <code>ISNULL</code> inside of a custom function?</p>