title: SSRS R2 Deployment issue with lookup built in function
body: <p>I have a SSRS R2 report built and it works fine on the preview tab but when I try to deploy the report to the report server I get the following error: </p>
  
  <blockquote>
    <p>Error    1    The Value expression for the text box ‘Textbox23’ refers to the field ‘Bats’.  Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope.        0    0    </p>
  </blockquote>
  
  <p>TextBox23's value is an expression:</p>
  
  <pre><code>=Lookup(Fields!PlayerId.Value, Fields!PlayerId.Value, Fields!Bats.Value, "profileDataSet") + " / " + Lookup(Fields!PlayerId.Value, Fields!PlayerId.Value, Fields!Throws.Value, "profileDataSet")
  </code></pre>
  
  <p>I have hard coded in a string value for the first part of the concatenated string and it just moves the error down to the "throw" part.  So obviously something is amiss with the lookup function. I have seen similar errors before when i have not had the report sections set to the correct dataSets but usually you see the msg when you try and preview the report not deploy it only.  I'm just lost on this one.</p>
  
  <p>Thanks in advance,
  Jeff</p>