.NET RDLC and multiple options not working

I have a report that takes two parameters from multiple text boxes that always end in null when passed to a saved process. Here is the code. Also, I went through the code, and the values ​​passed in parameters, but between passing in parameters, when proc is executed, it becomes null.

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            pnlRecords.Visible = true;

            ReportParameter p1 = new ReportParameter("DateStart", ReportDates1.DateStart);
            ReportParameter p2 = new ReportParameter("DateEnd", ReportDates1.DateEnd);

            this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { p1, p2 });
            this.ReportViewer1.LocalReport.Refresh();
        }

      

What do you think?

0


a source to share


1 answer


I understood that. Here is what I am missing in the .cs file



ObjectDataSource1.SelectParameters[0].DefaultValue = ReportDates1.DateStart;
ObjectDataSource1.SelectParameters[1].DefaultValue = ReportDates1.DateEnd;
ObjectDataSource1.DataBind();

      

0


a source







All Articles