Saturday, February 25, 2012

pass a value from form to report

I have a form on which the user enters a date range. I would like the date range to be displayed at the top of the report

like: For Period 08/01/2006 - 08/31/2006

Is it possible to pass a value from a form into a label in a report?

You can pass information to a report using parameters. The form fields must be named exactly like the report parameters. You could then set the value of the label to the parameter value passed in from your form.

I have enountered problems when a form contained server side .NET controls. (if there are 2 report parameters, there can only be 2 fields in your form... and .net adds 2 form fields automatically to handle post-back and state information) To get around this limitation I used querystring parameters instead of posting via a form. (there is also a parameter length limitation using this approach however)

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

No comments:

Post a Comment