Home » SQL ServerRSS

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

 

2 Answers Found

 

Answer 1

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

 

Answer 2

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

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter