title: Formula Fields in filter generating invalid sql from java
body: <p>I'm calling the Crystal Reports API from <strong>java</strong> to run a report.</p>
  
  <p>In this report, i have a query filter that looks like this </p>
  
  <pre><code>{Employee.Type} &lt;&gt; "P" and
  {Employee.HireDate} IN {?FromDate} TO {?ToDate} and
  {@HAS_TAKEN_TIME_OFF}
  </code></pre>
  
  <p>where <code>@HAS_TAKEN_TIME_OFF</code> is a boolean returning Crystal Report <em>formula field</em>. This formula field performs a calculation against several other tables to figure out the boolean result of this. </p>
  
  <p>The sql that gets generated looks like this  </p>
  
  <pre><code>("Employee"."Type"&lt;&gt;'P' AND 
  ("Employee"."HireDate"&gt;=convert(datetime,'20110101 00:00:00.000') AND 
  "Employee"."HireDate"&lt;convert(datetime,'20120101 00:00:00.000')) 
  AND ())
  </code></pre>
  
  <p>Clearly that trailing <code>AND ()</code> is invalid sql and does not represent the calculation that SHOULD be in its place, and since this is being executed from java, the sql is being created from the API, and sent to the db without the Crystal Reports interface. </p>
  
  <p>within my java code, i certainly COULD perform my own replacement on this filter text by recursively replacing any function with the code from the function. I believe this is actually the job of the crystal reports API and i may simply be using this api incorrectly.</p>
  
  <p>What is needed within the crystal reports java api to generate the correct sql from java such that functions are properly included? Do i really need to do this work for crystal reports? </p>