I'm a long time reader and first time poster. I have scoured the web for 2 days straight to no avail and decided to ask for help. Let's see what y'all got! :)
(Sorry, since I'm a new user I can't post screen shots. Spent all that time for nothing. :()
Here's the situation:
1) I created simple SSRS 2008 report that includes a single-select drop down. For simplicity I have set the "Available Values" to a fixed set of values. (This issue also happens if you bind the drop down to a a result set, so the source of data doesn't seem relevant here.)
2) The report runs fine when running it in Report Builder and on the report server itself.
3) However when displaying the report from the ASP.NET server "ReportViewer开发者_开发知识库" control, the single select drop down doesn't get bound on postback. In other words, when I select a value in the drop down and click the "View Report" button, the report does not return results and the drop down goes back to the selected option "<Select a Value>".
4) This issue only happens with single-select drop downs. Multi-select dropdowns, text boxes, checkboxes etc do not have this issue.
5) For reference, here's how the control is set up. Aside from setting the ReportPath in the code behind (and only once, the first time the page is loaded), I don't manipulate the control at all.
<rsweb:ReportViewer ID="ReportViewer1" runat="server"
ProcessingMode="Remote"
Width="100%"
Height="800px"
AsyncRendering="False">
</rsweb:ReportViewer>
6) My development environment: VS.NET 2010, ASP.NET Web Forms, .NET 4 framework, Microsoft.ReportViewer.Common.dll (file version 10.0.30319.1)
I have scoured the web for a couple of days and I've found no references to others having this same problem and so either I'm doing something obviously wrong or my Googling skills suck. I found only one discussion thread that seemed related and had a proposed "solution": they created a class that manually parsed the ReportViewer control's posted-back values and put them into a List<ReportParameter> so that they could call ServerReport.SetParameters() manually (note: the solution on that page is for the VS.NET2005 control and needs to be tweaked to work with 2010). Sure, that'd work but why should I have to jump through that many hoops? Again, it leads me to believe I'm doing something fundamentally wrong.
Any ideas?
Are you setting things like ReportPath
and ReportServerUrl
in the code behind?
If so, make sure you have them inside if (!Page.IsPostBack) { }
精彩评论