title: Crystal Report Subreport
body: <p>I have this queries:</p>
  
  <pre><code>select idCustumer, Name, Address from Customer
  </code></pre>
  
  <p>This give me the header of the report, and this one:</p>
  
  <pre><code>select idCustomer, Description, Sum(Total) as Total from Product group by Description
  </code></pre>
  
  <p>First query runs:</p>
  
  <pre><code> idCustomer    Name     Address
       1        Phil       Fake Av. 1234
       2        John       Fake Av. 4321
  </code></pre>
  
  <p>The second:</p>
  
  <pre><code> idCustomer    Description    Sum(Total)
     1              PROD01          10
     1              PROD02          20
     2              PROD01          30
  </code></pre>
  
  <p>When i use generate a report using one customer it's ok. The problem is with 2 or more customers in the same report.</p>
  
  <p>What i do?</p>
  
  <p>I create 1 dataset with 2 tables (1 per query) linking them by idCustomer. I create a report using this dataset, the first table (header) works fine, it prints my four test customers.</p>
  
  <p>Then i add a SubReport.</p>
  
  <pre><code>rpt.Subreports(0).SetDataSource(subReportes.Tables(1)) 'Tables(1) is 2nd Query
  </code></pre>
  
  <p>But this print the same info again and again.</p>
  
  <p>My Report:</p>
  
  <pre><code> Customer: Phil  Address: Fake Av. 1234
  
   Order:
                PROD01          10
                PROD02          20
                PROD01          30
  
                Total           60
  
   Customer: John  Address: Fake Av. 4321
  
   Order:
                PROD01          10
                PROD02          20
                PROD01          30
  
                Total           60
  </code></pre>
  
  <p>Is there a guide or link where i can learn how to include this subreport so i get (or if there is a another way to accomplish this?)</p>
  
  <pre><code> Customer: Phil  Address: Fake Av. 1234
  
   Order:
                PROD01          10
                PROD02          20
  
                Total           30    
  
   Customer: John  Address: Fake Av. 4321
  
   Order: 
                PROD01          10
  
                Total           10
  </code></pre>
  
  <p>I'm using VS 2010 (VB), SQL Server 2008 R2, Crystal Report 2010</p>
  
  <p>Thanks!</p>