private void button1_Click(object sender, EventArgs e) { malop = cmbLop.SelectedValue.ToString(); rptDSSV rpt = new rptDSSV(malop); rpt.lbTenLop.Text = cmbLop.Text; ReportPrintTool print = new ReportPrintTool(rpt); print.ShowPreviewDialog(); }
private void btnPreview_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); String strLenh = "EXEC SP_InDanhSachSinhVien N'" + cmbMaLop.Text.Trim() + "'"; //MessageBox.Show(strLenh); dt = Program.ExecSqlDataTable(strLenh); rptDSSV rp = new rptDSSV(); rp.SetDataSource(dt); rp.SetParameterValue("tenLop", cmbTenLop.Text); crystalReportViewer1.ReportSource = rp; }