title: Selection Formula Pass-through not working with SQL Command Object
body: <p>I'm using Crystal Reports XI.  We use Crystal Reports embedded into a share point site written in C#/ASP.net.  Our web developers instatiate a report in code and pass the selection criteria by appending to the Select Formula object.</p>
  
  <p>The problem I'm running in to is that when I use a SQL Command Object, the selection formula is not being passed to the sql server as a where clause.  This causes the entire result set to be queried and then limited on the server.  For very large tables, this is causing a significant performance hit.</p>
  
  <p>Here's an example:
      SELECT foo.id, foo.code, foo.name
      FROM foo foo</p>
  
  <p>Select criteria is shown as:
      {Command.name} like "someName"</p>
  
  <p>If I then run the report the entire foo table is queried and then crystal reports limits from the entire set.</p>
  
  <p>If instead I do it based on the table without a command object, the WHERE clause is appended to the sql query and all the limiting is done at the db level.</p>
  
  <p>I'm assuming this occurs because a SQL command could potentially be very complex and adding a WHERE clause to the bottom isn't always possible.  My question then, is there any good way to force some sort of pass through.  Should I be talking to the C# devs and asking them to rework the way we pass parameters?</p>
  
  <p>Thanks for any help and discussions.</p>