private void WorkerMethodRpt(object sender, WaitWindowEventArgs e) { string path = Application.StartupPath; path = path.Replace("\\", "/"); path = path.Replace("/bin/Debug", ""); path = path + "/Dominio/Reportes/rptFrecEnf.rpt"; rpt.Load(path); Conexion.CMD.CommandText = this.sql; using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD)) { using (ReportsDS ds = new ReportsDS()) { ds.Clear(); da.Fill(ds, 0, int.Parse(spinner1.Value.ToString()), "FrecEnf"); rpt.SetDataSource(ds); } } //rpt.SetParameterValue("consul", e.Arguments[0].ToString()); //rpt.SetParameterValue("fi", e.Arguments[1].ToString()); //rpt.SetParameterValue("ff", e.Arguments[2].ToString()); rpt.SetParameterValue("texto", this.texto); e.Result = true; }
private void WorkerMethodRpt(object sender, WaitWindowEventArgs e) { string path = Application.StartupPath; path = path.Replace("\\", "/"); path = path.Replace("/bin/Debug", ""); path = path + "/Dominio/Reportes/rptTotVenEsp.rpt"; rpt.Load(path); Conexion.CMD.CommandText = this.sqlVenCons; using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD)) { using (ReportsDS ds = new ReportsDS()) { ds.Clear(); da.Fill(ds, "VenCons"); rpt.SetDataSource(ds); } } e.Result = true; }
private void WorkerMethodRpt(object sender, WaitWindowEventArgs e) { string path = Application.StartupPath; path = path.Replace("\\", "/"); path = path.Replace("/bin/Debug", ""); path = path + "/Dominio/Reportes/rptTotUser.rpt"; rpt.Load(path); Conexion.CMD.CommandText = this.vSQL; int count = 0; using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD)) { using (ReportsDS ds = new ReportsDS()) { ds.Clear(); da.Fill(ds, "TotUser"); count = ds.Tables["TotUser"].Rows.Count; foreach (DataRow row in ds.Tables["TotUser"].Rows) { row["Digitador"] = General.TradUser(row["Digitador"].ToString()); } rpt.SetDataSource(ds); } } e.Result = count.ToString(); }
private void WorkerMethodRptPagEsp(object sender, WaitWindowEventArgs e) { string path = Application.StartupPath; path = path.Replace("\\", "/"); path = path.Replace("/bin/Debug", ""); path = path + "/Dominio/Reportes/rptPagEsp.rpt"; rpt.Load(path); int count = 0; Conexion.CMD.CommandText = this.vSQL; using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD)) { using (ReportsDS ds = new ReportsDS()) { ds.Clear(); da.Fill(ds, "PagEsp"); count = ds.Tables["PagEsp"].Rows.Count; rpt.SetDataSource(ds); } } rpt.SetParameterValue("periodo", this.periodo); rpt.SetParameterValue("subtitle", this.subtitle); e.Result = count.ToString(); }
private void WorkerMethodRptProdMedCon(object sender, WaitWindowEventArgs e) { string path = Application.StartupPath; path = path.Replace("\\", "/"); path = path.Replace("/bin/Debug", ""); path = path + "/Dominio/Reportes/rptProdMedCon.rpt"; rpt.Load(path); int count = 0; string sql = "SELECT X.año, X.mes, X.fecha_atencion, X.medico, X.consultorio, SUM(X.ccon) AS cantidad, SUM(X.tcon) AS total, X.turno, X.cturno, X.horas, X.colegiatura, X.sueldo from (" + this.vSQL + ") X WHERE ccon>0 GROUP BY X.año, X.mes, X.fecha_atencion, X.medico, X.consultorio, X.turno, X.cturno, X.horas, X.colegiatura, X.sueldo"; sql = "SELECT Y.año, Y.mes, Y.fecha_atencion, Y.medico, Y.consultorio, SUM(Y.cantidad) AS cantidad, SUM(Y.total) AS total, Y.turno, Y.cturno, Y.horas, Y.colegiatura, SUM(Y.sueldo * Y.cturno) AS sueldo from (" + sql + ") Y GROUP BY Y.año, Y.mes, Y.fecha_atencion, Y.medico, Y.consultorio, Y.turno, Y.cturno, Y.horas, Y.colegiatura ORDER BY 4, 3, 8"; Conexion.CMD.CommandText = sql; using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD)) { using (ReportsDS ds = new ReportsDS()) { ds.Clear(); da.Fill(ds, "ProdMed"); count = ds.Tables["ProdMed"].Rows.Count; rpt.SetDataSource(ds); } } rpt.SetParameterValue("periodo", this.periodo); rpt.SetParameterValue("subtitle", this.subtitle); e.Result = count.ToString(); }
private void WorkerMethodRPT(object sender, WaitWindowEventArgs e) { int option = (int)e.Arguments[0]; string sql = e.Arguments[1].ToString(); string rptName = e.Arguments[2].ToString(); string rptTable = e.Arguments[3].ToString(); string nText = e.Arguments[4].ToString(); //define la ruta por defecto de la app string path = Application.StartupPath; path = path.Replace("\\", "/"); path = path.Replace("/bin/Debug", ""); //define el reporte dependiendo del tipo de seleccion path = path + "/Dominio/Reportes/" + rptName + ".rpt"; //carga el reporte rpt.Load(path); Conexion.CMD.CommandText = sql; using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD)) { using (ReportsDS ds = new ReportsDS()) { ds.Clear(); da.Fill(ds, rptTable); rpt.SetDataSource(ds); } } //setea los parametros del reporte Parte de atencion diario rpt.SetParameterValue("nText", nText); if (e.Arguments.Count > 0) { e.Result = e.Arguments[0].ToString(); } else { e.Result = "Proceso culminado."; } }
private void WorkerMethodRpt(object sender, WaitWindowEventArgs e) { string path = Application.StartupPath; path = path.Replace("\\", "/"); path = path.Replace("/bin/Debug", ""); string rptName = ""; string table = ""; if (rbVentas.Checked) { rptName = "rptVenxPac"; table = "VenxPac"; } else { rptName = "rptAtenxPac"; table = "AtenxPac"; } path = path + "/Dominio/Reportes/" + rptName + ".rpt"; rpt.Load(path); Conexion.CMD.CommandText = this.sql; using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD)) { using (ReportsDS ds = new ReportsDS()) { ds.Clear(); da.Fill(ds, table); rpt.SetDataSource(ds); } } rpt.SetParameterValue("paciente", txtPaciente.Text); e.Result = true; }
private void WorkerMethodRptProdMedPrcSOP(object sender, WaitWindowEventArgs e) { string path = Application.StartupPath; path = path.Replace("\\", "/"); path = path.Replace("/bin/Debug", ""); path = path + "/Dominio/Reportes/rptProdMedPrcSOP.rpt"; rpt.Load(path); int count = 0; string sql = ""; if (e.Arguments[0].ToString() == "PROCEDIMIENTO") { sql = "SELECT X.año, X.mes, X.fecha_atencion, X.medico, X.consultorio, X.producto, SUM(X.cprc) AS cantidad, SUM(X.tprc) AS total, '" + e.Arguments[0].ToString() + "' AS modo, X.sueldo FROM (" + this.vSQL + ") X WHERE X.cprc > 0 GROUP BY X.año, X.mes, X.fecha_atencion, X.medico, X.consultorio, X.producto, X.sueldo ORDER BY 9, 4, 3, 5, 6"; } else { sql = "SELECT X.año, X.mes, X.fecha_atencion, X.medico, X.consultorio, X.producto, SUM(X.csop) AS cantidad, SUM(X.tsop) AS total, '" + e.Arguments[0].ToString() + "' AS modo, X.sueldo FROM (" + this.vSQL + ") X WHERE X.csop > 0 GROUP BY X.año, X.mes, X.fecha_atencion, X.medico, X.consultorio, X.producto, X.sueldo ORDER BY 9, 4, 3, 5, 6"; } Conexion.CMD.CommandText = sql; using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD)) { using (ReportsDS ds = new ReportsDS()) { ds.Clear(); da.Fill(ds, "ProdMedPrcSOP"); count = ds.Tables["ProdMedPrcSOP"].Rows.Count; rpt.SetDataSource(ds); } } rpt.SetParameterValue("periodo", this.periodo); rpt.SetParameterValue("subtitle", this.subtitle); e.Result = count.ToString(); }
private void WorkerMethodRPT(object sender, WaitWindowEventArgs e) { //define la ruta por defecto de la app string path = Application.StartupPath; path = path.Replace("\\", "/"); path = path.Replace("/bin/Debug", ""); //define el reporte dependiendo del tipo de seleccion path = path + "/Dominio/Reportes/rptTalon.rpt"; //carga el reporte rpt.Load(path); Conexion.CMD.CommandText = getSql(e.Arguments[0].ToString(), e.Arguments[1].ToString(), e.Arguments[2].ToString(), e.Arguments[3].ToString()); using (SqlDataAdapter da = new SqlDataAdapter(Conexion.CMD)) { using (ReportsDS ds = new ReportsDS()) { ds.Clear(); da.Fill(ds, "Talon"); rpt.SetDataSource(ds); } } //setea los parametros del reporte Parte de atencion diario rpt.SetParameterValue("TituloReporte", "Talonario de documentos de venta"); rpt.SetParameterValue("Fecha", DateTime.Now.ToLongDateString()); if (e.Arguments.Count > 0) { e.Result = e.Arguments[0].ToString(); } else { e.Result = "Proceso culminado."; } }