Cannot compare data of types System.Int32 and System.String in Chart

7.8k views Asked by At

I am using Reporting Services 2012 and have a chart that uses a dataset that changes it's data based on parameters.

This data is just a bunch of periods formatted as YYYYMM an int, a machine number int, and numbers decimal(12,2). We select based on machine number and period and pull back all those numbers of decimal(12,2) and show them in the chart.

It works for most machines, but a few machines we pick we get the following error

An error occurred during local report processing. An error occurred during report processing. The processing of Parent for the chart 'chart1' cannot be performed. Cannot compare data of types System.Int32 and System.String. Please check the data type returned by the Parent.

A machine number that works is 516. One that doesn't is 517. Nothing is different in the returned SQL results from 516 and 517 besides different numbers, 5.23 instead of 5.17 as an example. There are no nulls in the data and no zeros, and definitely no strings.

Any help as to where to look next would be appreciated.

1

There are 1 answers

0
John Wesley Gordon On BEST ANSWER

I don't know if this will be helpful or not, but the fix to eliminate the error was to change the SQL query to

cast(machno as varchar) 

everywhere machno was in the query. This doesn't explain why the chart needed a string instead of an int.