Tuesday, June 26, 2007

SQL Reports: Execution '' cannot be found.

While developing a page to generate a weekly report using SQL server reporting services, I came across a bit of a funny error. The ReportViewer control was giving an error of "Execution '' cannot be found.", though this error was appearing as part of the report itself, and not being thrown back to the ASP.NET application.
After a fair bit of pondering and head-scratching, a working solution was discovered - albeit one that I don't really understand why it works, since the original error is still a bit of a mystery.

Basically, it all boils down to the fact that the ReportViewer control was on the same .aspx page as the page that the user selects the parameters for the report (in this case, the department). So once the user chose a department, the page would post-back to itself, the parameter selection panel would be hidden, and the ReportViewer panel would be shown. Once this was seperated into two seperate pages, with the first using a cross-page postback to call the page with the report, it all worked perfectly. I can only assume this to be an issue caused by the report doing something even while hidden that later messes things up. It works now though, which is all that matters ;)

No comments: