开发者

Flushing newest parameters from ReportViewer control to the ServerReport from code

开发者 https://www.devze.com 2023-04-06 02:48 出处:网络
After a user edits report parameters, at some point I try to access new parameters with _reportViewer.ServerReport.GetParameters()

After a user edits report parameters, at some point I try to access new parameters with

_reportViewer.ServerReport.GetParameters()

Since that gives only the parameters user has submitted to the server with click on the View Report button, I'm looking to:

a) Simulate click on a View Button from code or

b) Get those parameters in some other way, preferably one that doesn't involve reflection.

How could I "flush" the c开发者_StackOverflow中文版urrent parameters from the automatically generated report control from code?


If you call ReportViewer1.ServerReport.GetParameters() from the ReportViewer1 UnLoad event you will get the values the client entered.

ASP.NET:

<rsweb:ReportViewer ID="ReportViewer1" 
                            runat="server" 
                            ProcessingMode="Remote" 
                            AsyncRendering="true" 
                            EnableViewState="true" 
                            OnUnload="ReportViewer1_Unload">

Codebehind:

    protected void ReportViewer1_Unload(object sender, EventArgs e)
    {
        ReportParameterInfoCollection ParameterCollection = ReportViewer1.ServerReport.GetParameters();
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号