title: Crystal Report Error in formula This field name is not known
body: <p>When I call ExportToDisk(). In some machine do well. But in some machine throw the exception.</p>
  
  <p><strong>Exceptoion</strong> </p>
  
  <blockquote>
    <p><strong>This field name is not known.</strong>
    Error in File C:\Windows\TEMP\RPTH010_Report01 {C0D0E863-1741-4917-A455-B23347EA4FD6}.rpt:
    <strong>Error in formula</strong>  &lt;填單日期>. 
    'numberVar RocDateNumber := {RPTH010_Report01.D01_APLDATE};'
    <strong>This field name is not known</strong>.<br>
    <strong>This field name is not known</strong>.
    Error in File C:\Windows\TEMP\RPTH010_Report01 {C0D0E863-1741-4917-A455-B23347EA4FD6}.rpt:
    <strong>Error in formula</strong>  &lt;填單日期>. 
    'numberVar RocDateNumber := {RPTH010_Report01.D01_APLDATE};'
    <strong>This field name is not known</strong>.</p>
  </blockquote>
  
  <p><strong>stack trace</strong></p>
  
  <blockquote>
    <p>CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
    CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
    CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
    CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
    CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)
    JcsWebSolution.Report.CRDocument.SaveToDisk()
    mOffice.Models.Report.ASSET.RPTH010_Report01.PrintReport()
    mOffice.Models.Report.ReportBase.PrintProcess()</p>
  </blockquote>
  
  <p><strong>My system</strong></p>
  
  <ul>
  <li>CrystalDecisions.CrystalReports.Engine.dll, v10.5.3700.0</li>
  <li>CrystalDecisions.Shared.dll, v10.5.3700.0</li>
  <li>Window Server 2012 R2</li>
  <li>Visual Studio 2013</li>
  </ul>
  
  <p>I try to fixed the bug by</p>
  
  <ul>
  <li>Reinstall crystal report runtime SP12.</li>
  <li>Checking the font is in system.</li>
  </ul>
  
  <p>And I try to print a report without formula and it can export well. And I add the concat string formula it just broken.</p>
  
  <p><strong>My code</strong></p>
  
  <pre><code>public class result
  {
    public string { get; set;}
  }
  
  public bool DoExport()
  {
    List&lt;result&gt; test = new List&lt;result&gt;();
    test.Add(new result { test = "123" });
  
    DataTable input = ListToDataTable(test);
  
    input.TableName = "test";
    m_RptDataSet.Tables.Add(input);
  
    ReportDocument m_ReportDocument = new ReportDocument();
  
    m_ReportDocument.Load(HttpContext.Current.Server.MapPath("~/RPT/test.rpt"));
    m_ReportDocument.SetDataSource(input);
    m_ReportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, "test.pdf");
  
    m_ReportDocument.Close();
    m_ReportDocument.Dispose();
  
    m_ReportDocument = null;
  }
  
  public  DataTable ListToDataTable&lt;T&gt;(List&lt;T&gt; list)        
  {
    PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(T));
  
    DataTable dt = new DataTable();
  
    object[] values;
  
    for (int i = 0; i &lt; props.Count; i++)            
    {            
      PropertyDescriptor prop = props[i];
      dt.Columns.Add(prop.Name, prop.PropertyType);            
    }
  
    foreach (T item in list)
    {
      values = new object[props.Count];
      for (int i = 0; i &lt; values.Length; i++)
      {
        values[i] = props[i].GetValue(item);
      }
  
      dt.Rows.Add(values);
    }
  
    return dt;
  }
  </code></pre>
  
  <p><strong>concat string formula</strong></p>
  
  <blockquote>
    <p>{RPTH040_Test.test} + " test Function"</p>
  </blockquote>
  
  <p>But in other machine just fine. Does anyone has the same problem?</p>
  
  <p><strong>Updated</strong></p>
  
  <p>I test a new report which have 3 records without formula. I find that the report can export, but does not show records. So I guess the main reason is that SetDataSource() doesn't work in my machine(windows 2012 R2).
  I try to add the code to Web.config.</p>
  
  <pre><code>&lt;startup useLegacyV2RuntimeActivationPolicy="true"&gt;
    &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt;
  &lt;/startup&gt;
  </code></pre>
  
  <p>It still not work. Does anyone know about this?</p>