title: RDLC Lookup not working
body: <p>I have a <code>Table</code> that has a set of data with integers that mark where to look in another <code>dataset</code> for their string description. I have tried to use:</p>
  
  <pre><code>=LOOKUP(
          CINT(Fields!LTC_Leak.Value),
          CINT(Fields!LTC_Leak.Value),
          Fields!LTC_LeakDesc.Value,
          "LeakCheckTypes"
          )
  </code></pre>
  
  <p>This should be using the integer field <code>LTC_Leak</code> from the details <code>dataset</code> the table is scoped too and lookup the row in the <code>"LeakCheckTypes"</code> <code>dataset</code> for it's description but i keep getting the error:</p>
  
  <pre><code>The Value expression for the text box 'LeakCheckType' refers to the field 'LTC_LeakDesc'. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope.
  </code></pre>
  
  <p>I have used the debugger to check and all the <code>datasets</code> are present, named properly, and have all the proper data. Anyone have an idea what I am doing wrong here?</p>
  
  <p>Adding xml from the datasetmodel I used (shortened to the affected tables)</p>
  
  <pre><code>    &lt;xs:element name="Details" msprop:Generator_TableClassName="DetailsDataTable" msprop:Generator_TableVarName="tableDetails" msprop:Generator_RowChangedName="DetailsRowChanged" msprop:Generator_TablePropName="Details" msprop:Generator_RowDeletingName="DetailsRowDeleting" msprop:Generator_RowChangingName="DetailsRowChanging" msprop:Generator_RowEvHandlerName="DetailsRowChangeEventHandler" msprop:Generator_RowDeletedName="DetailsRowDeleted" msprop:Generator_RowClassName="DetailsRow" msprop:Generator_UserTableName="Details" msprop:Generator_RowEvArgName="DetailsRowChangeEvent"&gt;
        &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
            &lt;xs:element name="Row" msprop:Generator_ColumnVarNameInTable="columnRow" msprop:Generator_ColumnPropNameInRow="Row" msprop:Generator_ColumnPropNameInTable="RowColumn" msprop:Generator_UserColumnName="Row" type="xs:string" minOccurs="0" /&gt;
            &lt;xs:element name="OPRID" msprop:Generator_ColumnVarNameInTable="columnOPRID" msprop:Generator_ColumnPropNameInRow="OPRID" msprop:Generator_ColumnPropNameInTable="OPRIDColumn" msprop:Generator_UserColumnName="OPRID" type="xs:string" minOccurs="0" /&gt;
            &lt;xs:element name="NAME" msprop:Generator_ColumnVarNameInTable="columnNAME" msprop:Generator_ColumnPropNameInRow="NAME" msprop:Generator_ColumnPropNameInTable="NAMEColumn" msprop:Generator_UserColumnName="NAME" type="xs:string" minOccurs="0" /&gt;
            &lt;xs:element name="LTC_Cure" msprop:Generator_ColumnVarNameInTable="columnLTC_Cure" msprop:Generator_ColumnPropNameInRow="LTC_Cure" msprop:Generator_ColumnPropNameInTable="LTC_CureColumn" msprop:Generator_UserColumnName="LTC_Cure" type="xs:string" minOccurs="0" /&gt;
            &lt;xs:element name="LTC_Leak" msprop:Generator_ColumnVarNameInTable="columnLTC_Leak" msprop:Generator_ColumnPropNameInRow="LTC_Leak" msprop:Generator_ColumnPropNameInTable="LTC_LeakColumn" msprop:Generator_UserColumnName="LTC_Leak" type="xs:string" minOccurs="0" /&gt;
            &lt;xs:element name="LTC_VacuumCheck" msprop:Generator_ColumnVarNameInTable="columnLTC_VacuumCheck" msprop:Generator_ColumnPropNameInRow="LTC_VacuumCheck" msprop:Generator_ColumnPropNameInTable="LTC_VacuumCheckColumn" msprop:Generator_UserColumnName="LTC_VacuumCheck" type="xs:string" minOccurs="0" /&gt;
            &lt;xs:element name="LTC_VacuumInterval" msprop:Generator_ColumnVarNameInTable="columnLTC_VacuumInterval" msprop:Generator_ColumnPropNameInRow="LTC_VacuumInterval" msprop:Generator_ColumnPropNameInTable="LTC_VacuumIntervalColumn" msprop:Generator_UserColumnName="LTC_VacuumInterval" type="xs:string" minOccurs="0" /&gt;
            &lt;xs:element name="LTC_VacuumCheckType" msprop:Generator_ColumnVarNameInTable="columnLTC_VacuumCheckType" msprop:Generator_ColumnPropNameInRow="LTC_VacuumCheckType" msprop:Generator_ColumnPropNameInTable="LTC_VacuumCheckTypeColumn" msprop:Generator_UserColumnName="LTC_VacuumCheckType" type="xs:string" minOccurs="0" /&gt;
          &lt;/xs:sequence&gt;
        &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  
      &lt;xs:element name="LeakCheckTypes" msprop:Generator_TableClassName="LeakCheckTypesDataTable" msprop:Generator_TableVarName="tableLeakCheckTypes" msprop:Generator_TablePropName="LeakCheckTypes" msprop:Generator_RowDeletingName="LeakCheckTypesRowDeleting" msprop:Generator_RowChangingName="LeakCheckTypesRowChanging" msprop:Generator_RowEvHandlerName="LeakCheckTypesRowChangeEventHandler" msprop:Generator_RowDeletedName="LeakCheckTypesRowDeleted" msprop:Generator_UserTableName="LeakCheckTypes" msprop:Generator_RowChangedName="LeakCheckTypesRowChanged" msprop:Generator_RowEvArgName="LeakCheckTypesRowChangeEvent" msprop:Generator_RowClassName="LeakCheckTypesRow"&gt;
        &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
            &lt;xs:element name="LTC_Leak" msprop:Generator_ColumnVarNameInTable="columnLTC_Leak" msprop:Generator_ColumnPropNameInRow="LTC_Leak" msprop:Generator_ColumnPropNameInTable="LTC_LeakColumn" msprop:Generator_UserColumnName="LTC_Leak" type="xs:int" /&gt;
            &lt;xs:element name="LTC_LeakDesc" msprop:Generator_ColumnVarNameInTable="columnLTC_LeakDesc" msprop:Generator_ColumnPropNameInRow="LTC_LeakDesc" msprop:Generator_ColumnPropNameInTable="LTC_LeakDescColumn" msprop:Generator_UserColumnName="LTC_LeakDesc"&gt;
              &lt;xs:simpleType&gt;
                &lt;xs:restriction base="xs:string"&gt;
                  &lt;xs:maxLength value="20" /&gt;
                &lt;/xs:restriction&gt;
              &lt;/xs:simpleType&gt;
            &lt;/xs:element&gt;
            &lt;xs:element name="Leak_Tolerance" msprop:Generator_ColumnVarNameInTable="columnLeak_Tolerance" msprop:Generator_ColumnPropNameInRow="Leak_Tolerance" msprop:Generator_ColumnPropNameInTable="Leak_ToleranceColumn" msprop:Generator_UserColumnName="Leak_Tolerance" type="xs:decimal" minOccurs="0" /&gt;
            &lt;xs:element name="LC_Length" msprop:Generator_ColumnVarNameInTable="columnLC_Length" msprop:Generator_ColumnPropNameInRow="LC_Length" msprop:Generator_ColumnPropNameInTable="LC_LengthColumn" msprop:Generator_UserColumnName="LC_Length" type="xs:int" minOccurs="0" /&gt;
            &lt;xs:element name="VTA" msprop:Generator_ColumnVarNameInTable="columnVTA" msprop:Generator_ColumnPropNameInRow="VTA" msprop:Generator_ColumnPropNameInTable="VTAColumn" msprop:Generator_UserColumnName="VTA" type="xs:boolean" minOccurs="0" /&gt;
          &lt;/xs:sequence&gt;
        &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
  </code></pre>
  
  <p>XML from the RDLC file:</p>
  
  <pre><code>&lt;DataSet Name="LeakCheckTypes"&gt;
    &lt;Query&gt;
      &lt;DataSourceName&gt;OprData&lt;/DataSourceName&gt;
      &lt;CommandText&gt;/* Local Query */&lt;/CommandText&gt;
    &lt;/Query&gt;
    &lt;Fields&gt;
      &lt;Field Name="LTC_Leak"&gt;
        &lt;DataField&gt;LTC_Leak&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.Int32&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
      &lt;Field Name="LTC_LeakDesc"&gt;
        &lt;DataField&gt;LTC_LeakDesc&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.String&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
      &lt;Field Name="Leak_Tolerance"&gt;
        &lt;DataField&gt;Leak_Tolerance&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.Decimal&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
      &lt;Field Name="LC_Length"&gt;
        &lt;DataField&gt;LC_Length&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.Int32&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
      &lt;Field Name="VTA"&gt;
        &lt;DataField&gt;VTA&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.Boolean&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
    &lt;/Fields&gt;
    &lt;rd:DataSetInfo&gt;
      &lt;rd:DataSetName&gt;OprData&lt;/rd:DataSetName&gt;
      &lt;rd:SchemaPath&gt;C:\Users\aridder\Desktop\AC Recipe Builder\AC Recipe Builder\OprReports\OprData.xsd&lt;/rd:SchemaPath&gt;
      &lt;rd:TableName&gt;LeakCheckTypes&lt;/rd:TableName&gt;
      &lt;rd:TableAdapterFillMethod&gt;Fill&lt;/rd:TableAdapterFillMethod&gt;
      &lt;rd:TableAdapterGetDataMethod&gt;GetData&lt;/rd:TableAdapterGetDataMethod&gt;
      &lt;rd:TableAdapterName&gt;LeakCheckTypesTableAdapter&lt;/rd:TableAdapterName&gt;
    &lt;/rd:DataSetInfo&gt;
  &lt;/DataSet&gt;
  
  &lt;DataSet Name="Details"&gt;
    &lt;Query&gt;
      &lt;DataSourceName&gt;OprData&lt;/DataSourceName&gt;
      &lt;CommandText&gt;/* Local Query */&lt;/CommandText&gt;
    &lt;/Query&gt;
    &lt;Fields&gt;
      &lt;Field Name="Row"&gt;
        &lt;DataField&gt;Row&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.String&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
      &lt;Field Name="OPRID"&gt;
        &lt;DataField&gt;OPRID&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.String&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
      &lt;Field Name="NAME"&gt;
        &lt;DataField&gt;NAME&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.String&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
      &lt;Field Name="LTC_Cure"&gt;
        &lt;DataField&gt;LTC_Cure&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.String&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
      &lt;Field Name="LTC_Leak"&gt;
        &lt;DataField&gt;LTC_Leak&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.String&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
      &lt;Field Name="LTC_VacuumCheck"&gt;
        &lt;DataField&gt;LTC_VacuumCheck&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.String&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
      &lt;Field Name="LTC_VacuumInterval"&gt;
        &lt;DataField&gt;LTC_VacuumInterval&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.String&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
      &lt;Field Name="LTC_VacuumCheckType"&gt;
        &lt;DataField&gt;LTC_VacuumCheckType&lt;/DataField&gt;
        &lt;rd:TypeName&gt;System.String&lt;/rd:TypeName&gt;
      &lt;/Field&gt;
    &lt;/Fields&gt;
    &lt;rd:DataSetInfo&gt;
      &lt;rd:DataSetName&gt;OprData&lt;/rd:DataSetName&gt;
      &lt;rd:SchemaPath&gt;C:\Users\aridder\Desktop\AC Recipe Builder\AC Recipe Builder\OprReports\OprData.xsd&lt;/rd:SchemaPath&gt;
      &lt;rd:TableName&gt;Details&lt;/rd:TableName&gt;
      &lt;rd:TableAdapterFillMethod /&gt;
      &lt;rd:TableAdapterGetDataMethod /&gt;
      &lt;rd:TableAdapterName /&gt;
    &lt;/rd:DataSetInfo&gt;
  &lt;/DataSet&gt;
  </code></pre>