Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net RDLC报告查看器-如何以编程方式重置输入参数_Asp.net_Webforms_Rdlc_Report Viewer2010 - Fatal编程技术网

Asp.net RDLC报告查看器-如何以编程方式重置输入参数

Asp.net RDLC报告查看器-如何以编程方式重置输入参数,asp.net,webforms,rdlc,report-viewer2010,Asp.net,Webforms,Rdlc,Report Viewer2010,我的网站上有一个RDLC控件。这是客户端报告。我在Visual Studio 2010中使用ASP.net 3.5。报表将使用许多筛选条件作为输入参数。有一个SQl server 2008 R2存储过程生成结果。其中一个输入是带有相关日历控件的日期时间文本框。有一个“刷新”按钮。单击此按钮将刷新报告。我想为date添加一些验证。我所有的验证都很好。我的问题是,当用户在datetime文本框中输入错误字符时,报告会失败,这是正确的,但当用户点击刷新按钮时,尽管错误消失,报告仍会显示错误消息 在本地

我的网站上有一个RDLC控件。这是客户端报告。我在Visual Studio 2010中使用ASP.net 3.5。报表将使用许多筛选条件作为输入参数。有一个SQl server 2008 R2存储过程生成结果。其中一个输入是带有相关日历控件的日期时间文本框。有一个“刷新”按钮。单击此按钮将刷新报告。我想为date添加一些验证。我所有的验证都很好。我的问题是,当用户在datetime文本框中输入错误字符时,报告会失败,这是正确的,但当用户点击刷新按钮时,尽管错误消失,报告仍会显示错误消息

在本地调用报表时,是否有方法刷新参数。 这是我的简单代码-

    protected void BtnRefresh_Click(object sender, EventArgs e)
    {
        //check object session
        LoginSessionData.IsValid();

        //Hide the display panel 
        DisplayMessage.Visible = false;

        //add a try catch block here
        try
        {

            ReportViewer1.LocalReport.Refresh();
        }
        catch (Exception ex)
        {
            m_logger.Error(ex);
        }
    }

您可以使用以下方法将参数值设置为空白或其他方式:

ReportParameter p1 = new 
      ReportParameter("ShowDescriptions", checkBox1.Checked.ToString());
ReportParameter p2 = new 
      ReportParameter("MyDate", DateTime.Now.ToString());
ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { p1, p2 });