title: RDLC - Replace #Error with empty string
body: <p>I have a <code>Tablix</code> where I group totals. However, my columns data can be sometimes a <em>string</em>, a <em>int</em>, a <em>decimal</em>, etc... it depends of called stored procedure. NOTE: it's a dynamic process.</p>
  
  <p><strong>Setting DataTable values</strong></p>
  
  <pre><code>var queryResult = typeof(MethodsToRdlc).GetMethod(conf.SelectMethod).Invoke(new MethodsToRdlc(), new object[] { });
  DataTable result = queryResult.ToDataTable();
  </code></pre>
  
  <p>So, when the data is <em>decimal</em> or <em>int</em> or <em>other numeric type</em>, I want to sum all in my <code>Total</code>. For doing that have I this expression which works lovely:</p>
  
  <p><strong>Total expression</strong></p>
  
  <pre><code>=Replace(Format(Sum(CDbl(Replace(Fields!DataColumn8.Value, ",", "."))), "F"), ".", ",")
  </code></pre>
  
  <p>However, when data type isn't numeric I'm getting <strong>#Error</strong>. How can I replace <strong>#Error</strong> with a empty string (for example)?</p>
  
  <p><strong>I already tried this:</strong></p>
  
  <pre><code>=IIf(IsNumeric(Fields!DataColumn8.Value), Replace(Format(Sum(CDbl(Replace(Fields!DataColumn8.Value, ",", "."))), "F"), ".", ","), "")
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>=IIf(IsNumeric(Replace(Fields!DataColumn8.Value, ",", ".")), Replace(Format(Sum(CDbl(Replace(Fields!DataColumn8.Value, ",", "."))), "F"), ".", ","), "")
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>=IIf(CDbl(Fields!DataColumn8.Value) = 0, "", Replace(Format(Sum(CDbl(Replace(Fields!DataColumn8.Value, ",", "."))), "F"), ".", ","), "")
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>=IIf(CDbl(Replace(Fields!DataColumn8.Value, ",", ".")) = 0, "", Replace(Format(Sum(CDbl(Replace(Fields!DataColumn8.Value, ",", "."))), "F"), ".", ","), "")
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>=IIf(IsNothing(IsNumeric(Replace(Fields!DataColumn8.Value, ",", "."))), "", Replace(Format(Sum(CDbl(Replace(Fields!DataColumn8.Value, ",", "."))), "F"), ".", ","))
  </code></pre>
  
  <p>and nothing works... always shows <strong>#Error</strong>.</p>