April 22, 2008 at 5:28 pm
Does anyone know how to get the messagebox or msgbox function to work (pop up) via custom code after deploying to a report server?
I have followed these 2 posts for creating ad-hoc date validation:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=829175&SiteID=1 (created custom function)
http://msdn2.microsoft.com/en-us/library/ms155798.aspx (added reference to System.Windows.Forms.MessageBox)
It works great on my development box via report designer - preview, but as soon as I deploy, the messagebox no longer displays.
I know the first thing people are going to say is why are you doing date validation here instead of using a custom asp front end. We have a custom front end that is quite hefty and complicated, but we still have a few reports that are out of the ordinary and we would like to check for a few additional validation factors.
I'm not saying this is the best way, I'm just asking because I have been asked to make it so. 😉
Thanks for any help.
-M
April 22, 2008 at 10:08 pm
I am afraid that you really can't achieve what you are after. The code you include within your report actually executes on the web server (within reporting services) and anything that that code does has finished executing before anything HTML is send to the user's workstation.
If the message boxes did produce anything, the message box would appear on console of the web server. Since no one is likely to be sitting at the console of the web server, the report would just sit there waiting (forever) for someone to click OK.
What is the requirement you are actually trying to implement ?
April 23, 2008 at 10:19 am
Thanks for the reply.
About 10 % of our reports have some 'weird' date restrictions - for example - in some reports, it may be perfectly acceptable to do a future date, in others it won't work or will produce inaccurate results.
I would like to catch this on a report by report basis and I would like to throw up a message box and then take them back to the default report parameters.
Unfortunately, as you have stated, it doesn't sound like this is possible.
On to plan B...
Thanks again.
April 24, 2008 at 9:23 am
Try this (I think):
Catch the exception in your data pull, so that when it occurs you don't retrieve any rows at all. Then, on your output table, change the "NoRows" property, to display a validation message.
You could also get a little fancier, controlling visability of certain objects (i.e. toggling between table and a text box) that has more detailed format control. I'd suggest putting you edit checks in some custom code , where you could set visibility flags and/or text messages.
April 28, 2008 at 9:23 am
Thank you. Your suggestion sounds like a good idea!
-M
June 25, 2008 at 8:38 am
Hi,
One thing that I don't understand from the prevous explanation about why the message popup box doesn't come back to the client from the server. If this is true then why can a popup box come back when there is no value in the parameter? Somehow Reporting Services can send a popup back to the client in this instance. Thank you in advance for any insight someone can give me on this.
June 25, 2008 at 11:32 am
Remember, MSRS is a web service. So code executes on the server. If the code issues a message box, it would execute and the server and the message box would appear on the server (not in the users browser).
Always better to work with the rendering objects that are part of MSRS.
June 25, 2008 at 12:06 pm
Hi,
I am probably not explaining myself well enough, or not totally understanding your reply. If I don't put in any value for a parameter, such as StartDate, and then click on View Report I will get the attached pop-up message box. What I am asking is how can Reporting Services, which is running on the server, send the pop-up message and we cannot?
June 25, 2008 at 12:53 pm
Yes, this is the same question I had/have.
I have a case started with Microsoft that has been going on for a few months now.
They are 'working on it' and admit it is an issue.
I have asked if there is any way to create/edit an assembly, or any other part of SSRS on the server or elsewhere to get this to work.
So far, no luck.
Keep this post updated if you run into anything.
Thanks,
-M
June 25, 2008 at 12:56 pm
Because there's some java deployed to support it in the case of parameters (the controls are client side). At this point, I haven't tried to break into any of that, and I wouldn't expect it to be supported.
September 25, 2008 at 8:16 am
Thank goodness, now I know I'm not doing much wrong. It's amazing how a small shortcoming like this can impact my life. I'll be watching this topic.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply