0

I have a button in user control and another button in report-viewer form to load the rdlc. Whenever I click the print button from my user-control and the validation passes, the click event handler in the report-viewer does work when data to be loaded are only a less row, but when data to be loaded is more than 1 page the click event handler does not fire properly in the load event handler, causing only a blank page in the report-viewer unless i manually click the button.

my codes: (In user-control)

private void btn_print_Click(object sender, EventArgs e)
        {
            pharm_printprev frm1 = new pharm_printprev(this);
            frm1.Show();
        }

        public DateTime DTPicker
        {

            get { return _FromTime.Value; }
            set { _FromTime.Value = value; }

        }
        public DateTime DTPicker1
        {
            get { return _ToTime.Value; }
            set { _ToTime.Value = value; }

        }

my codes: (Reportviewer Form)

    private PHARM_OPDSALES _PHARM_OPDSALES = null;
            public pharm_printprev(UserControl callingForm)
            {
                _PHARM_OPDSALES = callingForm as PHARM_OPDSALES;
                InitializeComponent();
            }
    
            private void pharm_printprev_Load(object sender, EventArgs e)
            {
               
                lbl_print_refrsh_Click(sender, e);

            }
private void lbl_print_refrsh_Click(object sender, EventArgs e)
        {

            string df1 = dm_dtepckr.Value.ToString("yyyy-MM-dd HH:mm:ss tt");
            string dt1 = dm_dtepckr2.Value.ToString("yyyy-MM-dd HH:mm:ss tt");

            this.dMDatableTableAdapter.Fill(this.DSdispense_sum.DMDatable,  dm_dtepckr.Value = this._PHARM_OPDSALES.DTPicker, dm_dtepckr2.Value = this._PHARM_OPDSALES.DTPicker1);

            ReportParameter[] Rparam = new ReportParameter[]
            {
              
              //new ReportParameter("Param1", dm_dtepckr.Value.Date.ToLongDateString()),
              //new ReportParameter("Param2", dm_dtepckr2.Value.Date.ToLongDateString()),
              
              new ReportParameter("Param1", df1),
              new ReportParameter("Param2", dt1),

            };
            rptdsch1.LocalReport.SetParameters(Rparam);
            rptdsch1.RefreshReport();

What could be the problem during the validation and why it only accepts less rows to trigger the button event handler in the reportviewer form?

J.szareyo
  • 25
  • 8

0 Answers0