private void btnReporte_Click(object sender, EventArgs e) { DataTable dt = ArmoSql(); ManejaArticulos objManejaArticulos = new ManejaArticulos(); frmReportes objfrmReporte; objfrmReporte = new frmReportes("ReporteArticulos.rdlc", objManejaArticulos.ReporteDeArticulosGral(dt), "ArticulosReporteGral"); objfrmReporte.Show(); }
private void btnReporte_Click(object sender, EventArgs e) { string strSql; strSql = "select c.fechaalta,c.nrofactura,p.id, p.razonsocial,c.total "; strSql += " from compras c, dbo.Proveedores p "; strSql += " where c.proveedorid=p.id and c.fechabaja is null "; if (txtCodigoCompra.Text != "") { if (cboCodigoCompra.Text == "=") { strSql += " and c.nrofactura = '" + txtCodigoCompra.Text + "')"; } if (cboCodigoCompra.Text == "like") { strSql += " and c.nrofactura like '" + txtCodigoCompra.Text + "%' )"; } if (cboCodigoCompra.Text == "path") { strSql += " and c.nrofactura like '%" + txtCodigoCompra.Text + "%' )"; } } if (cboProveedor.Text != "") { strSql += " and p.id =" + cboProveedor.SelectedValue; } strSql += " and c.fechaalta between DATEADD(D, 0, DATEDIFF(D, 0," + "'" + dtpFechaCompraDesde.Text + "'))" + " and DATEADD(D, 0, DATEDIFF(D, 0," + "'" + dtpFechadeCompraHasta.Text + "'))"; // strSql += " group by f.facturaid, f.fechaalta ,f.ubicacion, f.estado, e.emp_nombre + ' ' + e.emp_apellido , c.cli_nombre + ' '+ c.cli_apellido , f.total "; LlenaCombos objLlenaCombos = new LlenaCombos(); DataTable dt = objLlenaCombos.GetSqlDataAdapterbySql(strSql); ManejaCompras objManejaCompras = new ManejaCompras(); frmReportes objfrmReporte; objfrmReporte = new frmReportes("ReporteCompras.rdlc", objManejaCompras.ReporteDeCompras(dt), "ComprasReporte"); objfrmReporte.Show(); }
private void CargoDatos() { string strSql = ""; strSql = "select * from ("; if (ckPagos.Checked) { strSql += ArmoPagos(); if (ckDevoluciones.Checked) { strSql += " UNION "; strSql += ArmoDevoluciones(); } } else { strSql += ArmoDevoluciones(); } strSql += " ) tabla order by fecha"; LlenaCombos objLlenaCombos = new LlenaCombos(); DataTable dt = objLlenaCombos.GetSqlDataAdapterbySql(strSql); ManejaVentas objManejaVentas = new ManejaVentas(); frmReportes objfrmReporte; objfrmReporte = new frmReportes("ReportePagosDevoluciones.rdlc", objManejaVentas.ReporteDePagosDevoluciones(dt), "VentasReportePago"); objfrmReporte.Show(); }