title: SSRS passing Report Parameters
body: <p>I am having a difficult day trying to decode the underlying issue with this one </p>
  
  <p>I have a form that the user enters information.  That information is passed through URL to SSRS</p>
  
  <p>I am getting the error </p>
  
  <pre><code>An error has occurred during report processing. (rsProcessingAborted)
  Query execution failed for data set 'Report'. (rsErrorExecutingCommand)
  Must declare the scalar variable "@ReportType". Must declare the scalar variable "@StoreNum". Must declare the scalar variable "@ReportType". Must declare the scalar variable "@StoreNum". 
  </code></pre>
  
  <p>The query is this </p>
  
  <pre><code>IF @ReportType = 'RE'
  BEGIN
   exec  proc_Report_RETaxInvoices_InterActive @StoreNum, @StartDate, @EndDate, @TaxId, @BusinessName, @Attention, @LocatedIn, @Street, @AdditionalAddress, @City, @State, @PostalCode
  END
  ELSE IF @ReportType = 'RY'
  BEGIN
   exec proc_Report_ARTaxInvoices_InterActive @StoreNum, @StartDate, @EndDate, @TaxId, @BusinessName, @Attention, @LocatedIn, @Street, @AdditionalAddress, @City, @State, @PostalCode
  END
  </code></pre>
  
  <p>My Report Parameters look like this
  <img src="https://i.stack.imgur.com/POJOd.jpg" alt="enter image description here">
  The url is long and nasty but looks valid </p>
  
  <pre><code>http://&lt;SECRET&gt;/ReportServer/Pages/ReportViewer.aspx?%2fSubway%2fAccounting%2fAccounting%2fTax+Report+Interactive&amp;rs:Command=Render&amp;rc:Parameters=false&amp;ReportType=RE&amp;StoreNum=25159&amp;StartDate=11%2F1%2F2012&amp;EndDate=11%2F1%2F2012&amp;TaxId=1&amp;BusinessName=1&amp;Attention=1&amp;LocatedIn=1&amp;Street=1&amp;AdditionalAddress=1&amp;City=1&amp;State=1&amp;PostalCode=1
  </code></pre>
  
  <p>Notice that </p>
  
  <pre><code>&amp;ReportType=RE&amp;StoreNum=25159
  </code></pre>
  
  <p>is in the query string</p>
  
  <p>When I run the report from the query editor in the SSRS BIDS environment, a result set is returned.</p>
  
  <p>So I am at a loss for this error </p>