Example #1
0
        private void btnPreview_Click(object sender, EventArgs e)
        {
            DateTime   DateFrom     = this.dtDateFrom.DateTime;
            DateTime   DateTo       = this.dtDateTo.DateTime;
            String     idNV         = cbbMaNV.Text.ToString();
            String     timeDateFrom = String.Format("{0:yyyy-MM-dd}", DateFrom);
            String     timeDateTo   = String.Format("{0:yyyy-MM-dd}", DateTo);
            Connection cnn          = Access.CnnList[comboBox1.SelectedIndex];
            string     maCN         = cnn.MaCN;

            string[] param = { idNV, timeDateFrom, timeDateTo, maCN };

            Report    rpt = new Report();
            DataTable x   = rpt.HoatDongNhanVien(param);

            REPORT.rptHoatDongNhanVien report = new REPORT.rptHoatDongNhanVien();
            report.DataSource = x;
            report.DataMember = x.TableName;
            report.ShowPreviewDialog();
        }