Search This Blog

The Value expression for the text box ‘XYZ’ refers to the field ‘XYZ’. Report item expressions can only refer to fields within the current dataset scope Issue fixed in SSRS Report

The Value expression for the text box ‘XYZ’ refers to the field ‘XYZ’. Report item expressions can only refer to fields within the current dataset scope Issue fixed in SSRS Report

The Reason of this error is you have changed any column name in your query and report is referring to old column Name of the sql,to fix this one change your Report old column Name to New column Name.

In order to reproduce create any report preview the report, Now, change ur column name in your
query inside Dataset Try to preview the Report .
This will throw the above error.

Eg
What i did was i Changed EmpName column to EmployeeName.
For Eg
Suppose my dataset query is

Select empid,Empname from Employee
where Empname in (@EmpName)

I preview the Report it works fine with above query.

then

I opened the Dataset change the Query to  

Select empid,Empname as EmployeeName from Employee
where Employeename in (@EmpName)

I preview the report the Report was throwing above error.

In order to fix this issue .

In Design view of Report
Go to your table  click on 2 row below columnName (EmpName)  like in below Screenshot.
In my Screenshot it task change Depends according to your column Name of reports  Select new value of your columnName from Dropdown 
Preview the Report-The Issue will  be fixed..

2 comments:

  1. Finally an easy answer after searching through complicated instructions. Thanks!

    ReplyDelete