Display message box in SSRS 2008 R2 report
I'm trying to figure out how to display a message box in a ssrs 2008 r2 report. I have custome code that validates a couple of parameters, and I want to display an error message if a user enters an incorrect parameter. I included 'system.windows.forms' as a reference in my report, and tried to use 'system.windows.forms.messagebox.show(errormsg) but I keep getting an error. I created a hidden parameter that references the custom code. Any help would be greatly appreciated. Thanks in advance. Dan1104
October 18th, 2010 5:03pm

I'm trying to figure out how to display a message box in a ssrs 2008 r2 report. I have custome code that validates a couple of parameters, and I want to display an error message if a user enters an incorrect parameter. I included 'system.windows.forms' as a reference in my report, and tried to use 'system.windows.forms.messagebox.show(errormsg) but I keep getting an error. I created a hidden parameter that references the custom code. Any help would be greatly appreciated. Thanks in advance. Dan1104
Free Windows Admin Tool Kit Click here and download it now
October 18th, 2010 5:15pm

Hi Dan, In the current reporting services, there is no process that i am aware of to display message box. The "system.windows.forms" code is used in windows form while report manager/report server works under web forms, so it does not work. To work around this situation, the common way is to display a message on the top of the report, follow these steps: 1. Add a TextBox at the top of the report, and type the message. Then, write an expression to control its visibilty so that the message is displayed if the user enters an incorrect parameter, vice versa. 2. Drag a Rectangle control from the toolbox onto the report body, put the report items except the newly added textbox in the step1 into it, then write an expression to control its visibilty so that the Rectangle shows if the users enters a correct parameter, vice versa. thanks, Jerry
October 20th, 2010 4:40am

Thanks Jerry, This Answer helped me
Free Windows Admin Tool Kit Click here and download it now
December 3rd, 2010 10:32am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics