Beispiel #1
0
        private void btnReportKhacPhucPhongNgua_Click(object sender, EventArgs e)
        {
            Model.Function.ConnectSanXuat();//Mo ket noi
            string sqlQuery = string.Format(@"select * from ViewChatLuongHoatDong where 
                                   LoaiDeNghi like 'NCR' and ID like '{0}'", iD);
            ReportKhacPhucPhongNgua kppn = new ReportKhacPhucPhongNgua();

            kppn.DataSource = Function.GetDataTable(sqlQuery);
            kppn.DataMember = "Table";
            kppn.CreateDocument(false);
            kppn.PrintingSystem.ExportOptions.PrintPreview.DefaultFileName = "NCR-No-" + iD;
            PrintTool tool = new PrintTool(kppn.PrintingSystem);

            kppn.ShowPreviewDialog();
            Function.Disconnect();
        }
Beispiel #2
0
        private void PrintNCR_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            ketnoi    kn = new ketnoi();

            dt = kn.laybang(@"select R.*,D.Cai,D.Kg,D.Thongtin,D.ChiPhiDonHang from tblNCR R
                inner join NcrDatHang D
                on R.NcrID=D.NcrID where R.NcrID='" + txtNcrID.Text + "'");
            ReportKhacPhucPhongNgua xRNcr = new ReportKhacPhucPhongNgua();

            xRNcr.DataSource = dt;
            xRNcr.DataMember = "Table";
            xRNcr.CreateDocument(false);
            xRNcr.PrintingSystem.ExportOptions.PrintPreview.DefaultFileName = txtNcrID.Text;
            PrintTool tool = new PrintTool(xRNcr.PrintingSystem);

            xRNcr.ShowPreviewDialog();
            kn.dongketnoi();
        }