Showing posts with label messages. Show all posts
Showing posts with label messages. Show all posts

Tuesday, March 27, 2012

Customize Error Messages

Is there a way to customize the error messages returned from SSRS2005?

I do not want error messages like

"Access deined for <computername>\<username>'

But a more user friendly message returned.

How can that be done?

Thanks.

Have you looked at Books Online under the error handling (Reporting Services) section?|||

Yes. It does not have anything to actually customize the errors returned from the SQL Server Reporting Server. DO you have a specific link I can look at?

|||

Try this...

http://msdn2.microsoft.com/en-us/library/ms153616.aspx

The solution may lie in the ASP.NET programming. Another thing to try is to modify the error pages in the IIS Management Console and see if these get displayed upon the specific error.

Customize Error Messages

Is there a way to customize the error messages returned from SSRS2005?

I do not want error messages like

"Access deined for <computername>\<username>'

But a more user friendly message returned.

How can that be done?

Thanks.

Have you looked at Books Online under the error handling (Reporting Services) section?|||

Yes. It does not have anything to actually customize the errors returned from the SQL Server Reporting Server. DO you have a specific link I can look at?

|||

Try this...

http://msdn2.microsoft.com/en-us/library/ms153616.aspx

The solution may lie in the ASP.NET programming. Another thing to try is to modify the error pages in the IIS Management Console and see if these get displayed upon the specific error.

Wednesday, March 7, 2012

Custom Error Messages

My understanding is that in a stored procedure (or any code for that
matter) if an error occurs you can detect it by checking @.@.error
variable and raise your own error with raiserror statement.

The problem is that the original error is not suppressed. For example
I received the following output from a stored procedure from the same
error:

Server: Msg 547, Level 16, State 1, Procedure spUpdateSecurityMaster,
Line 49
INSERT statement conflicted with COLUMN FOREIGN KEY constraint
'FK_SM_mm_Exchange_Exchanges'. The conflict occurred in database
'Trading', table 'Exchanges', column 'IsoCode'.
Server: Msg 50000, Level 14, State 1, Procedure
spUpdateSecurityMaster, Line 57
Unable to insert into "SM_mm_Exchange" table
The statement has been terminated.

So why should we bother to use raiseerror if the orginal error is
going to be given to the client anyways? The end result is two error
messages.On 1 Oct 2003 06:41:42 -0700, JayCallas@.hotmail.com (Jason) wrote:

>My understanding is that in a stored procedure (or any code for that
>matter) if an error occurs you can detect it by checking @.@.error
>variable and raise your own error with raiserror statement.
>The problem is that the original error is not suppressed. For example
>I received the following output from a stored procedure from the same
>error:
>Server: Msg 547, Level 16, State 1, Procedure spUpdateSecurityMaster,
>Line 49
>INSERT statement conflicted with COLUMN FOREIGN KEY constraint
>'FK_SM_mm_Exchange_Exchanges'. The conflict occurred in database
>'Trading', table 'Exchanges', column 'IsoCode'.
>Server: Msg 50000, Level 14, State 1, Procedure
>spUpdateSecurityMaster, Line 57
>Unable to insert into "SM_mm_Exchange" table
>The statement has been terminated.
>So why should we bother to use raiseerror if the orginal error is
>going to be given to the client anyways? The end result is two error
>messages.
The reason is that SQL Server will not allow you to trap errors of a
certain severity.

If the error was less severe then what you want to happen will work.|||Jason (JayCallas@.hotmail.com) writes:
> My understanding is that in a stored procedure (or any code for that
> matter) if an error occurs you can detect it by checking @.@.error
> variable and raise your own error with raiserror statement.
> The problem is that the original error is not suppressed. For example
> I received the following output from a stored procedure from the same
> error:
> Server: Msg 547, Level 16, State 1, Procedure spUpdateSecurityMaster,
> Line 49
> INSERT statement conflicted with COLUMN FOREIGN KEY constraint
> 'FK_SM_mm_Exchange_Exchanges'. The conflict occurred in database
> 'Trading', table 'Exchanges', column 'IsoCode'.
> Server: Msg 50000, Level 14, State 1, Procedure
> spUpdateSecurityMaster, Line 57
> Unable to insert into "SM_mm_Exchange" table
> The statement has been terminated.
> So why should we bother to use raiseerror if the orginal error is
> going to be given to the client anyways? The end result is two error
> messages.

It's actually even three. That last "The statement has been terminated"
is a separate message.

No, there is not much with a RAISERROR here. But there might be
occasions where RAISERROR is your sole choice. Say that you have a
procedure that has an parameter that controls the logic, and it
have have the values A, B and C. You procedure would look like:

IF @.action = 'A'
BEGIN
...
END
ELSE IF @.action = 'B'
BEGIN
...
END
ELSE IF @.action = 'C'
BEGIN
...
END
ELSE
BEGIN
RAISERROR ('Illegal action "%s" passed!', 16, 1, @.action)
RETURN 1
END

And, no there is no way to suppress the error message from SQL. You
need a client to do that.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Erland Sommarskog <sommar@.algonet.se> wrote in message news:<Xns9408F0145FFYazorman@.127.0.0.1>...
> It's actually even three. That last "The statement has been terminated"
> is a separate message.
> No, there is not much with a RAISERROR here. But there might be
> occasions where RAISERROR is your sole choice. Say that you have a
> procedure that has an parameter that controls the logic, and it
> have have the values A, B and C. You procedure would look like:
> IF @.action = 'A'
> BEGIN
> ...
> END
> ELSE IF @.action = 'B'
> BEGIN
> ...
> END
> ELSE IF @.action = 'C'
> BEGIN
> ...
> END
> ELSE
> BEGIN
> RAISERROR ('Illegal action "%s" passed!', 16, 1, @.action)
> RETURN 1
> END
> And, no there is no way to suppress the error message from SQL. You
> need a client to do that.

I figured that. So basically it makes no sense to use raiserror when a
database statement (delete, insert, update) is used since one will
already be thrown.|||Jason (JayCallas@.hotmail.com) writes:
> I figured that. So basically it makes no sense to use raiserror when a
> database statement (delete, insert, update) is used since one will
> already be thrown.

Yes, it would be fairly redundant. I guess there might be occassions
where it could make sense, for instance convey information about what
was going on, like "Error when adding account 98989". But as a matter
of routine, it would be pointless.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Custom error messages

Some of our reports use a stored proc as the source for base data. The proc contains RAISEERROR statements to handle error scenarios.

Is there a way in which I could display the message that is output from the RAISEERROR statements in the report?

ThanksThis is not natively supported. You would need to return it as a data column.

Saturday, February 25, 2012

Custom Data Extension Trace

Hi,
could anybody help to figure out what is the correct (recommended) way to
write trace messages for custom data processing extension? I have written
such an extension and I would like to enable trace for it to be able to see
how it performs through the time.
I tried to write trace messages using RSTrace, but I got permission
exception and I guess it means that reporting services prevents to use this
class in different assembly than ReportingServices.Diagnostics.dll.
Then I tried to add trace listener (TextWriterTraceListener) to
<system.diagnostics> section of ReportingServicesService.exe.config file.
Doing so I got an IOException that the target file is used by different
process and report server refuse to start at all.
Is it possible to somhow use System.Diagnostics.Trace in custom data
extension?
Thanks,
MarekI'm not sure, but I'm just guessing you'll need to add some lines to the
rssrvpolicy.config file located here:
C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer
Have you done this?
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Marek Zoth" <MarekZoth@.discussions.microsoft.com> wrote in message
news:EE4A6E80-6FDB-4900-8835-5F8117285E6F@.microsoft.com...
> Hi,
> could anybody help to figure out what is the correct (recommended) way to
> write trace messages for custom data processing extension? I have written
> such an extension and I would like to enable trace for it to be able to
> see
> how it performs through the time.
> I tried to write trace messages using RSTrace, but I got permission
> exception and I guess it means that reporting services prevents to use
> this
> class in different assembly than ReportingServices.Diagnostics.dll.
> Then I tried to add trace listener (TextWriterTraceListener) to
> <system.diagnostics> section of ReportingServicesService.exe.config file.
> Doing so I got an IOException that the target file is used by different
> process and report server refuse to start at all.
> Is it possible to somhow use System.Diagnostics.Trace in custom data
> extension?
> Thanks,
> Marek|||Thanks Jeff,
I tried, my extension runs in FullTrust mode and I tried to increase
permissions also for ReportingServices.Diagnostics.dll but no success. The
exception I got is:
--> System.Security.SecurityException: Request for the permission of type
System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at DataExtension.TACommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.ReportingServices.ReportProcessing.a0.v()
The state of the failed permission was:
<IPermission
class="System.Security.Permissions.StrongNameIdentityPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100272736AD6E5F9586BAC2D531EABC3ACC666C2F8EC879FA94F8F7B0327D2FF2ED523448F83C3D5C5DD2DFC7BC99C5286B2C125117BF5CBE242B9D41750732B2BDFFE649C6EFB8E5526D526FDD130095ECDB7BF210809C6CDAD8824FAA9AC0310AC3CBA2AA0523567B2DFA7FE250B30FACBD62D4EC99B94AC47C7D3B28F1F6E4C8"/>
I am not sure what it exactly means but looking to MSDN it seeem to me RS
prevents calling RSTrace. Or am I wrong?
Any idea how to write traces in custom data extensions is appreciated.
Thanks,
M.
"Jeff A. Stucker" wrote:
> I'm not sure, but I'm just guessing you'll need to add some lines to the
> rssrvpolicy.config file located here:
> C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer
> Have you done this?
> --
> Cheers,
> '(' Jeff A. Stucker
> \
> Business Intelligence
> www.criadvantage.com
> ---
> "Marek Zoth" <MarekZoth@.discussions.microsoft.com> wrote in message
> news:EE4A6E80-6FDB-4900-8835-5F8117285E6F@.microsoft.com...
> > Hi,
> >
> > could anybody help to figure out what is the correct (recommended) way to
> > write trace messages for custom data processing extension? I have written
> > such an extension and I would like to enable trace for it to be able to
> > see
> > how it performs through the time.
> >
> > I tried to write trace messages using RSTrace, but I got permission
> > exception and I guess it means that reporting services prevents to use
> > this
> > class in different assembly than ReportingServices.Diagnostics.dll.
> >
> > Then I tried to add trace listener (TextWriterTraceListener) to
> > <system.diagnostics> section of ReportingServicesService.exe.config file.
> > Doing so I got an IOException that the target file is used by different
> > process and report server refuse to start at all.
> >
> > Is it possible to somhow use System.Diagnostics.Trace in custom data
> > extension?
> >
> > Thanks,
> >
> > Marek
>
>