how to treat/handle an exception and display a custom error message on Reporting Services - sql-server

Fellow developers,
I'm creating a report to be seen directly by the clients, so I need to ensure maximum user-friendliness. When the user types an invalid date string the report throws a rsReportParameterTypeMismatch and displays an error messages like this:
An error occurred during local reoprt processing
Query Execution Failed for data set 'myDataSet'
I want to replace this cryptic (for the final user) message for a more friendly custom message. How or where can I write them? How do I intercept the exception? I don't need anything too complex, just changing the words, perhaps colors and sizes would suffice.
I thank thee in advance for thy willingness to help.

take a look at Custom error pages in Reporting Services 2008

Related

How to deal Large Dataset using Eloquent?

In my table there are more than 5.600.000 records. When I try to get records using PAGINATE(15), after a very long processing server response Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, contact#example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.". Please help, Thanks in Advance.
It's probably caused by php.ini configuration.
You can check your error logs for more info (php error logs or laravel /storage/logs).
It can be memory_limit, max_execution_time or some other setting in php.ini
Its the problem with paginate(). paginate() retrieves all the rows in a table and counts the total rows to determine the total no of pages required. Since you have 5600,000 rows in the table, it is taking a long time to retrieve the results which eventually might be reaching max_execution_time or memory_limit.
I suggest the best way is to use simplePaginate()

What could cause my report to fail solely in the ReportViewer component?

I'm using SSRS to manage our reporting needs. I've built the first report in BIDS and have deployed it to the report server. I am able to run the report using the (browser-based) Report Manager.
For some reason, I am unable to display the report using the WinForms-based Report Viewer component. The parameters are displayed correctly, but when I click "View Report" I get:
The report execution ..... has expired or cannot be found. (rsExecutionNotFound)
As per this question, I suspected that it could be a timeout issue. But the report runs very quickly and the issue does not disappear when I set the timeout options (both at report and server level) to "Do not timeout report".
I've read elsewhere that the issue can be caused by a difference in timezone settings between Report Server and SQL Server. This doesn't seem to explain my issue however, as I am still able to generate reports using the browser-based interface.
What could cause my report to fail solely in the ReportViewer component?
UPDATE - As suggested by #lrb, I had a look at the logs. The error in the Report Viewer component seems to correlate with the following:
library!ReportServer_0-9!2dcc!07/23/2014-17:45:14:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ExecutionNotFoundException: , Microsoft.ReportingServices.Diagnostics.Utilities.ExecutionNotFoundException: The report execution hcy3t555yc0rqp45rpovkz55 has expired or cannot be found.;
webserver!ReportServer_0-9!2dcc!07/23/2014-17:45:14:: e ERROR: Reporting Services error Microsoft.ReportingServices.Diagnostics.Utilities.ExecutionNotFoundException: The report execution hcy3t555yc0rqp45rpovkz55 has expired or cannot be found.
at Microsoft.ReportingServices.WebServer.HttpClientRequest.InitForRequest(CatalogItemContext context, UserContext userCtx)
at Microsoft.ReportingServices.WebServer.ReportServiceHttpHandler.RenderReport()
at Microsoft.ReportingServices.WebServer.ReportServiceHttpHandler.DoStreamedOperation(StreamedOperation operation)
at Microsoft.ReportingServices.WebServer.ReportServiceHttpHandler.RenderPageContent()
at Microsoft.ReportingServices.WebServer.ReportServiceHttpHandler.RenderPage()
To my (admittedly inexperienced) eyes, this isn't really any more informative than what I was seeing in the Report Viewer; i.e. "The report execution has expired or cannot be found" Maybe I'm missing something though?
Moving from design-time report selection (using the smart tag) to run-time selection (using the SOAP interface) seems to have resolved this issue.
My guess is that the reportViewer.RefreshReport(); call is responsible. This would suggest that Report Viewer will always try to grab an old version of the report, rather than requesting a new one. Since increasing the timeout didn't help at all I'm not sure why this behaviour would be useful, but I'd happily be corrected on this point.

Silverlight Exception Message is different on other machines

I am currently stuck with the following problem and running desperately out of ideas, any clues are welcome!
We are using a custom built framework that loads what we call "pages" on demand for the UI, each of these "pages" is a self contained Silverlight XAML that is loaded on demand via:
XamlReader.Load(somePageXamlFile)
It may happen that a part inside this xaml is outdated, so a try / catch block ensures that a XAMLParseException is caught and the respective error handled.
Our current error handling is heavily based on the message of the exception, e.g. we expect a message like this:
"The type 'someType' could not be found. [Line: x Position: y]"
-> we parse the message string and replace the essential xaml parts with custom logic to make it valid again and display info for administrators.
The problem:
Some test machines throw the same exception, but with a different message!
Errormessage there:
"Error 2502 An error has occured."
This breaks our "safety net" logic for this case and currently we can not figure out any reason for this.
Solutions or proposals are very welcome,
thanks in advance!
-Steve
After long and hard search we came down to the following: The clients and the development machines seem to have different versions of the Microsoft agcore.dll (development machines have 2 different version in different paths). As this is the core of the exception we suppose this is the reason for the different error message - we were unable to fix this issue however (we cannot be sure what dll our clients get during SL5 download...) therefore we decided to rewrite the whole code segment to not make use of the exception message text at all. Lesson learned.
Thanks for the feedback. -Steve

SQLException Obtaining more information

Currently working with converting SQLException error messages into messages that are more useful for the end user. My largest issue has been finding the information I'm looking for.
For instance, error code 8114 is
"Error converting data type [Type1] to [Type2]"
And error code 8152 is
"String or binary data would be truncated"
Using ADO.NET in VB.NET with SQLServer, is there a simple way to figure out which columns are affected by these errors?
The problem is that the error from SQL Server does not give that information so the only way to identify which field is causing the issue is to break apart your SQL statement to run it for the separate fields individually. That sounds like a lot of work for something the developer should be testing to make sure that it does not happen to begin with. There are errors that are not the developer's fault, but the two you listed here are things the developer should be keeping from happening and should be part of the unit tests for the process.
Some of the errors I can think of that are not a developer error, are ones to do with connection errors with SQL Server or corruption errors with the database.
I actually like the fact that my user's can't always figure out what is causing the problem because it tends to force them to tell me there is a problem with my program. If they figure out how to get around an error that I should have fixed, they tend to not tell me there is a problem and sometimes it has been years before I found out there was an issue.

How to detect and wrap "debugging resource strings are unavailable" w/o installing developer runtime?

I'm working on a Silverlight app that has an UnhandledException handler in the App class, which shows a message box containing the exception message. This is often fine for custom exceptions. However, it's not so good for built-in exceptions (e.g. NullReferenceException), because users don't have the developer runtime installed and therefore get a rather ugly "Debugging resource strings are unavailable" message.
My first thought (which I quickly dismissed) was to check the exception message for "debugging resource strings". I imagine if someone's running the app in, say, French, they'd get something like "les chaînes de ressources de débogage", so that wouldn't work.
Perhaps there's a way for a Silverlight app to detect whether it's running in the end-user runtime vs. the developer runtime? I've looked in the Application and Environment and Deployment classes, and haven't found anything.
I suppose this wouldn't be an issue if the application always threw custom exceptions anytime some sort of message needed to be shown to the user. Then I could easily hide the non-custom ones with a friendlier generic message. Is that the best/only option?
Just from an application design point of view, what user will know what to do with any kind of techy error message? "The value 'null' was found where an instance of an object was required." huh??
A simple "Something bad happened, if it continues, please contact support" should suffice. Just ensure that you log whatever bad happened somewhere, so that when you get the phone call/email, you can retrieve the issue in whatever techy details you require to solve the problem.

Resources