title: How to populate Crystal Reports with SQL
body: <p>Since there doesn't seem to be any way to load old VB6 (ActiveReports) reports in .Net, I need to recreate dozens of reports in .Net.  I'd like to do this in the least painful way possible.</p>
  
  <p>In VB6, the original authors simply did something like this for every report:</p>
  
  <pre><code>adoConn.ConnectionString = globalConnectionObject.ConnectionString
  adoConn.Source = ReportFunctions.GetAllUsers()
  </code></pre>
  
  <p><code>GetAllUsers()</code> returns an SQL string which selects a bunch of fields; those fields are then used in the report.</p>
  
  <p>Now:<br>
  <strong>How can I do something similar in .Net</strong> (either using the built-in Crystal Reports, or the built-in <em>"Microsoft Reporting Technology"</em>)?</p>
  
  <p>I can't get "Database Expert" to recognize <code>globalConnectionObject</code> (an ADODB.Connection object); and if I fill a dataset and do</p>
  
  <pre><code>report.SetDataSource(dataSet)
  </code></pre>
  
  <p>It tells me <em>"The report has no tables."</em></p>
  
  <p>How do I populate a Crystal Reports report!?  <em>(the connection string/data location is not known at compile time)</em></p>