Please Suggest me!!! ERROR in SSRS Cannot compare data types of System.String and System.Int32 . Please check the data type returned by the filter expression

  • Helllo Everyone,

    I am building a tabular report in SSRS . Where i have to filter a field in dataset for specific values i don't why that filter is not working. Actually i am converting the Crystal report to SSRS report, where in Crystal report in Record Selection it is filtering the data like this @code In ['2', '3', '5', '7', '8', '101', '102', '103', '104', '110', '115', '120', '125',

    '201', '203', '204', '240', '245', '250', '255']. So in SSRS i have to do it in Filter section

    The field which need to be filter is coming through C sharp Assembly (Custom Library) i.e Cal_Code(Field name) . Its data type is String in C sharp Code. So i created a calculated field in dataset for Cal_Code(Field name).

    Then in data set Properties Window in the section Filters i have selected the Cal_Code but in data type options i only got 5 which are(Text,integer,Boolean,date/time,float). So i converted the Cal_Code in int by using expression =Cint(Cal_Code ) then selected the datatype integer and operator i used = because its not allowing to use IN (dont knw why?) the in Values i am providing all the values which i mention above 2, 3,5,7,8....

    and when i preview the report it giving me error

    "Cannot compare data types of System.String and System.Int32 . Please check the data type returned by the filter expression"

    Please suggest me i want this thing to be done.

    Thanks in advance.

    Developer

  • You need to put an equal sign in front of the values in the value setting of the filter.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply