SSRS show a error template instead of the real report if a stored procedure returns a null value

StackOverflow https://stackoverflow.com/questions/23681354

I am sure this is achievable. I have a SSRS report which is fetching data which is well and good. The report currently uses a parameter called BatchID, this parameter drives the report forward. If the user enters a invalid BatchID or non existing BatchID the report currently shows the default template and the data fields are blank (This is expected so I don't see anything wrong).

The new requirement I have is to check whether the BatchID entered by the user exists or not. If exists show the report if not. Show a different report template which will read BatchID invalid or something other message.

I am happy to write the stored procedure, my question is how do I show different report templates based on a condition.

Thanks for your help

有帮助吗?

解决方案

If you can use the same report, add visibility criteria to your items (Tablix,Charts etc.) based on this parameter (from stored procedure). And show another item like TextBox with message for unexpected BatchID.

其他提示

If you're using a table or matrix to display the data then you can set the NoRowsMessage property on the tablix control with your error message.
When no data is returned this message will be displayed instead of an empty table.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top