void TrichXuatBaoCaoMonHoc() { DatabaseBLL databasebll = new DatabaseBLL(); string con = null; con = databasebll.GetconnectionString(); string strConnect = "select l.MaLop,l.SiSo,ct.SoLuongDatMon ,ct.TiLeDatMon " + " from BAOCAOTONGKETMON bc, LOP l, CT_BCAOTONGKETMON ct " + " where bc.MaBCTKM = ct.MaBCTKM and ct.MaLop = l.MaLop " + " and MaHocKy = '" + cbHocKy_BCMH.Text + "' and MaNamHoc = '" + cbNamHoc_BCMH.Text + "' and bc.MaMonHoc = '" + cbMonHoc_BCMH.Text + "'"; // MessageBox.Show(strConnect); SqlDataAdapter adapter = new SqlDataAdapter(strConnect, con); DataSet datasetMonHoc = new DataSet(); adapter.Fill(datasetMonHoc, "MonHoc"); this.rpBaoCaoMon.LocalReport.ReportEmbeddedResource = "GUI.BaoCaoTongKet.ReportMonHoc.rdlc"; ReportDataSource rpdsMonHoc = new ReportDataSource(); rpdsMonHoc.Name = "BaoCaoMonHoc"; rpdsMonHoc.Value = datasetMonHoc.Tables[0]; rpBaoCaoMon.LocalReport.DataSources.Add(rpdsMonHoc); this.rpBaoCaoMon.RefreshReport(); }
void TrichXuatBaoCaoHocKy() { DatabaseBLL databasebll = new DatabaseBLL(); string con = null; con = databasebll.GetconnectionString(); string strConnect = "select bc.MaLop,l.SiSo, bc.SoLuongDat,bc.Tile" + " from BAOCAOTONGKETHOCKY bc, LOP l" + " where bc.MaLop = l.MaLop and MaHocKy= '" + cbHocKy_BCHK.Text + "' and MaNamHoc= '" + cbNamHoc_BCHK.Text + "'"; // MessageBox.Show(strConnect); SqlDataAdapter adapter = new SqlDataAdapter(strConnect, con); DataSet datasetHocky = new DataSet(); adapter.Fill(datasetHocky, "HocKy"); this.rpBaoCaoHocKy.LocalReport.ReportEmbeddedResource = "GUI.BaoCaoTongKet.ReportHocKy.rdlc"; ReportDataSource rpdsHocKy = new ReportDataSource(); rpdsHocKy.Name = "BaoCaoHocKy"; rpdsHocKy.Value = datasetHocky.Tables[0]; rpBaoCaoHocKy.LocalReport.DataSources.Add(rpdsHocKy); this.rpBaoCaoHocKy.RefreshReport(); }
void TrichXuatBaoCaoMonHoc() { // this.rpBaoCaoMon.RefreshReport(); DatabaseBLL databasebll = new DatabaseBLL(); string con = null; con = databasebll.GetconnectionString(); try { //cho he thong triger hoat dong cap nhat SqlConnection conn = new SqlConnection(con); conn.Open(); SqlCommand com = new SqlCommand(); com.CommandType = CommandType.Text; com.CommandText = " update CT_BCAOTONGKETMON set MaLop='L001' where MaLop='L001'"; com.Connection = conn; com.ExecuteNonQuery(); conn.Close(); } catch { } string strConnect = "select l.TenLop,l.SiSo,ct.SoLuongDatMon ,ct.TiLeDatMon " + " from BAOCAOTONGKETMON bc, LOP l, CT_BCAOTONGKETMON ct " + " where bc.MaBCTKM = ct.MaBCTKM and ct.MaLop = l.MaLop " + " and MaHocKy = '" + cbHocKy_BCMH.Text + "' and MaNamHoc = '" + cbNamHoc_BCMH.Text + "' and bc.MaMonHoc = '" + cbMonHoc_BCMH.Text + "'"; // MessageBox.Show(strConnect); SqlDataAdapter adapter = new SqlDataAdapter(strConnect, con); DataSet datasetMonHoc = new DataSet(); adapter.Fill(datasetMonHoc, "MonHoc"); // dataGridView1.DataSource = datasetMonHoc.Tables[0]; this.rpBaoCaoMon.LocalReport.ReportEmbeddedResource = "GUI.BaoCaoTongKet.ReportBaoCaoMonHoc.rdlc"; ReportParameter ReportParameterBaoCaoMonHoc = new ReportParameter ("ReportParameterBaoCaoMonHoc", cbHocKy_BCMH.Text + " " + cbNamHoc_BCMH.Text + " môn " + cbMonHoc_BCMH.Text); this.rpBaoCaoMon.LocalReport.SetParameters(ReportParameterBaoCaoMonHoc); ReportDataSource rpdsMonHoc = new ReportDataSource(); rpdsMonHoc.Name = "DataSetBaoCaoMonHoc"; rpdsMonHoc.Value = datasetMonHoc.Tables["MonHoc"]; rpBaoCaoMon.LocalReport.DataSources.Clear(); rpBaoCaoMon.LocalReport.DataSources.Add(rpdsMonHoc); this.rpBaoCaoMon.RefreshReport(); }
void TrichXuatBaoCaoHocKy() { //this.rpBaoCaoHocKy.Refresh(); DatabaseBLL databasebll = new DatabaseBLL(); string con = null; con = databasebll.GetconnectionString(); try { //cho he thong triger hoat dong cap nhat SqlConnection conn = new SqlConnection(con); conn.Open(); SqlCommand com = new SqlCommand(); com.CommandType = CommandType.Text; com.CommandText = " update BAOCAOTONGKETHOCKY set MaNamHoc = 'NH16-17' where MaNamHoc = 'NH16-17'"; com.Connection = conn; com.ExecuteNonQuery(); conn.Close(); } catch { } string strConnect = "select l.TenLop,l.SiSo, bc.SoLuongDat,bc.Tile" + " from BAOCAOTONGKETHOCKY bc, LOP l" + " where bc.MaLop = l.MaLop and MaHocKy= '" + cbHocKy_BCHK.Text + "' and MaNamHoc= '" + cbNamHoc_BCHK.Text + "'"; // MessageBox.Show(strConnect); SqlDataAdapter adapter = new SqlDataAdapter(strConnect, con); DataSet datasetHocky = new DataSet(); adapter.Fill(datasetHocky, "HocKy"); this.rpBaoCaoHocKy.LocalReport.ReportEmbeddedResource = "GUI.BaoCaoTongKet.ReportHocKy.rdlc"; ReportParameter ReportParameterTime = new ReportParameter("ReportParameterTime", cbHocKy_BCHK.Text + " " + cbNamHoc_BCHK.Text); this.rpBaoCaoHocKy.LocalReport.SetParameters(ReportParameterTime); ReportDataSource rpdsHocKy = new ReportDataSource(); rpdsHocKy.Name = "BaoCaoHocKy"; rpdsHocKy.Value = datasetHocky.Tables["HocKy"]; rpBaoCaoHocKy.LocalReport.DataSources.Clear(); rpBaoCaoHocKy.LocalReport.DataSources.Add(rpdsHocKy); this.rpBaoCaoHocKy.RefreshReport(); }