Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
rsassine
Starting Member
1 Post |
Posted - 2006-03-03 : 10:16:07
|
I would like to trap my own errors before SQL Server Reporting Services generates them. How do I do this within the report itself?For example in my report I have a cascading parameter, but the parent parameter returns a NULL and when the dataset for the child gets executed SRS dumps an error. I would like to know how to trap those errors and return something more useful to my audience, like 'Sorry, There were no data for this employee.'Thanks |
|
jhermiz
3564 Posts |
Posted - 2006-03-03 : 10:48:00
|
You wouldnt because you shouldnt be getting an error even if the parent parameter is null. It is not an RS problem, it is a problem in your stored procedure that you are not handling correctly. You either need to fix your sproc to handle nulls by using boolean logic @ParentID IS NULL OR ParentID = @ParentID. Or you would simply return 0 rows, no errors.Every report has a "No Rows" property. Look on your report properties on the bottom right, this is hte property you set when there is NO DATA returned. For instance, in my reports I have set the No Rows property to "No data is currently available at this time!". You can set it to whatever text message you want. You cannot avoid RS errors, they are part of the framework that RS has built on. Besides that error is in your code not rs.Jon Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]RS Blog -- [url]http://weblogs.sqlteam.com/jhermiz[/url] |
 |
|
|
|
|