title: Is thera a way to pass NULL value to Crystal Reports programmatically
body: <p>It is VS 2010 version. </p>
  
  <p>CR is able to accept NULL values, because when it prompts me for parameter values, there is cute little check box which says 'Set to NULL'. This is behavior that I need.</p>
  
  <p>But, I almost never call reports like that, I do it in code. So, if a user does not provide a value for a parameter, I would like to pass NULL value in its place, so I could do something differently in report itself.</p>
  
  <p>I've searched around net for ages, mostly in CR forums, and I've got number of solution, non of which actually works.</p>
  
  <p>This is one of them:</p>
  
  <pre><code>ParameterDiscreteValue objDiscreteValue = new ParameterDiscreteValue();
  objDiscreteValue.Value = null;
  rptH.SetParameterValue(parName, new ParameterDiscreteValue(objDiscreteValue));
  </code></pre>
  
  <p>CR says you haven't provided a value for ... parameter.</p>
  
  <p>I muscle solve it by creating double parameters. One real parameter, and one satellite parameter for it (boolean value, only to see if there is a value for real parameter). And it works. But it is tedious, and makes my generics (automatic prompting for parameters based on report metadata) very very hard.</p>
  
  <p>I am hoping someone has dug deep enough to find a solution for this problem.</p>
  
  <p>Regards,</p>