SSRS Subreport Reports “Error” for a New Data Column

This “bug” took me a while to track down… I have a report which embeds a subreport and returns the data to it. Along the way I realised the subreport needed an additional column. I edited the SQL in the Dataset and then reran the subreport. It loaded correctly. I then went back to my main report and ran it to find that the new column was returning “Error” for all values.

I tried recreating the subreport Dataset, the embedded object in the main report, and eventually the whole subreport itself. None of these worked. What was actually causing the problem was the Visual Studio cache that was created when it first ran the main report. Because I had subsequently edited the subreport, it was returning an extra column which it wasn’t expecting and so throwing an error. I’m not sure if there is front-end way of rebuilding the cache, however the simplest solution was to delete the .data file in the report folder, and the “bin” subfolder. These are then rebuilt the next time the project is opened.

Add comment

Fill out the form below to add your own comments