Monday, February 20, 2012

message box in reporting services

I have used this code pasted below to show message box in reports in Reporting services 2000.It works and pops up but only in development environment but not in production.I mean to say it works in Preview mode but when I have deployed the report it doesn't work.Doesn't even show any error message.

I don't know what would be the code and which assembly file should i Include. Any Ideas ......


Public Function FixDigits(ByVal s As string)
dim msg1 as string
msg1="Parameter is not a 20 digit number"
dim msg2 as string
msg2= "Parameter is not a number"

Dim title As String
title="Attention"
Dim style As MsgBoxStyle
Dim response As MsgBoxResult

style = MsgBoxStyle.OKONLY
if len(s)<>20 then
response = MsgBox(msg1, style, title)


elseif IsNumeric(s)=false then
response = MsgBox(msg2, style, title)

else
end if

End Function

It depends on the client you use to generate the reports. If it is an IDE (Visual Studio), the message box is displayed as it has VB runtime loaded on it. If it is a browser or a client application thru web services, it cannot be communicated to the client as they dont have VB runtime (it is available only on the report server).

Shyam

|||I guess that this is actually releated to another problem. The Messagebox command is executed on the server not on the client, so if the server and the client is one box (as in local development) you probably see the error message while after deploying the report to the report server you won′t see it.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||Thanks a lot .Now it makes sense to me .

No comments:

Post a Comment