title: Creating a Batch Report
body: <p>I am trying to create a batch report of multiple invoices using SSRS 2008 R2. </p>
  
  <p>I have created the initial invoice report and have it set up with a parameter; the parameter uses an InvoiceID to populate the data within the invoice report. </p>
  
  <p>I have created another report using lists, inside the list contains the information that was in my original invoice report but using a different parameter (BatchID). The problem I am running into with this is that instead of creating a single invoice for each invoiceID it is creating an invoice for each line item within each invoice. i.e.~ Instead of incorporating multiple items based on the InvoiceID (as the original report did) it is creating a report for each of the items.</p>
  
  <p>What would be the best way of running a batch of these invoices? Am I going about this the wrong way or am I on the right track but missing something?</p>
  
  <h2>Thanks in advance!</h2>
  
  <pre><code>SELECT i.InvoiceId, i.InvoiceNumber, i.BillTo_Line1, i.BillTo_Line2, i.BillTo_City, i.BillTo_StateOrProvince, i.BillTo_PostalCode, i.CustomerIdName, 
                       i.ce_OutstandingBalance, i.ce_BillToDate, i.ce_BillFromDate, i.TotalAmount, id.ProductIdName, id.ce_customeridName, id.ce_CustomerProductName, 
                       id.InvoiceDetailId, id.BaseAmount, id.PricePerUnit, id.ce_rate
  FROM 
                           Invoice AS i RIGHT OUTER JOIN
                           InvoiceDetail AS id ON i.InvoiceId = id.InvoiceId
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/gjPFc.png" alt="enter image description here">
  Once I enter the invoiceID I get my report
  <img src="https://i.stack.imgur.com/6p8u2.png" alt="enter image description here"></p>
  
  <p>My intent is to be able to run the report against multiple invoicesid numbers without having to select the invoice number itself. I have another table that collects the invoiceid's based on a batchid that they are run in. </p>
  
  <p>So far I have attempted to create a subreport with the original report and Create a separate report that uses a list and attempt to group by InvoiceID for each batchid. Though with each of these I have so far been unsuccessful. </p>
  
  <p>I am new to SSRS and have been pouring over documentation from MSDN about SSRS and the different abilities. </p>