Beispiel #1
0
    protected void CrystalReport1_Init(object sender, EventArgs e)
    {
        CrystalReport1 objRpt;

        objRpt = new CrystalReport1();


        String ConnStr = @"Data Source=SQLSRV\TuServidor;Initial Catalog=TuBasedeDatos;Persist Security Info=True;User ID=Tuusuario;Password=Tupassword";

        // LA DE ARRIBA ES NUESTRA CADENA DE CONEXION DEL SERVIDOR

        SqlConnection myConnection = new SqlConnection(ConnStr); // TIENEN QUE UTILIZAR EN EL USING LA CLASE DE System.Data.SqlClient

        String Query = "SELECT * FROM EjemploReportes";          // ESTE ES NUESTRO QUERY

        SqlDataAdapter adapter = new SqlDataAdapter(Query, ConnStr);

        Reportes Ds = new Reportes(); // ESTE ES EL NOMBRE DE NUESTRO DATASET

        adapter.Fill(Ds, "Reportes"); // ESTE Reportes ES EL NOMBRE DE NUESTRA TABLA DE DATOS QUE ESTA DENTRO DE NUESTRO DATASET


        objRpt.SetDataSource(Ds); frmReporte rpt = new frmReporte(); // ES EL FORM DONDE ESTA NUESTRO CRYSTAL REPORT VIEWER
        rpt.crystalReportViewer1.ReportSource = objRpt;              // ESTE ES NUESTRO REPORT VIEWER
        rpt.ShowDialog();                                            // AQUI LO MUESTRA
    }
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         if (dtpFechad.Value > dtpFechah.Value)
         {
             MessageBox.Show("Fecha inicial no puede ser mayor que la final!");
         }
         else
         {
             frmReporte obj = new frmReporte();
             if (string.IsNullOrEmpty(txtCodigo.Text))
             {
                 obj.Idproveedor = 0;
             }
             else
             {
                 obj.Idproveedor = Convert.ToInt16(txtCodigo.Text);
             }
             obj.Fechad  = dtpFechad.Value;
             obj.Fechah  = dtpFechah.Value;
             obj.Valor   = 10;
             obj.Reporte = "facturas_cxp.rdlc";
             obj.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        internal static void reportes(string nombreReporte, string tablaDataSet, object[] objeto, string mensaje, bool imprimir = false, object[] parametros = null)
        {
            frmReporte reporte = new frmReporte(nombreReporte, tablaDataSet);

            reporte.cargarDatos(tablaDataSet, objeto, mensaje, imprimir, parametros);
            reporte.ShowDialog();
        }
Beispiel #4
0
        private void btnReportes_Click(object sender, EventArgs e)
        {
            frmReporte ofrmReporte = new frmReporte();

            ofrmReporte.Show();
            this.Close();
        }
Beispiel #5
0
 private void MostrarReporte(DataTable dt)
 {
     using (var reporte = new CupónDePago())
     {
         reporte.Database.Tables["CupónPago"].SetDataSource(dt);
         using (var f = new frmReporte(reporte, txtDescripción.Text)) f.ShowDialog();
     }
 }
        private void btnRegistrar_Click(object sender, EventArgs e)
        {
            string mensaje = "";

            errorProvider1.Clear();
            if (Utilidades.ValidarForm2(this, errorProvider1) == false)
            {
                return;
            }
            try
            {
                CalcularTotal();
                C.Documento  = txtDocumento.Text;
                C.Nota       = txtNota.Text;
                C.Fecha      = dtpFecha.Value;
                C.Idusuario  = Program.Idusuario;
                C.Idsucursal = Program.Idsucursal;
                C.Factura    = txtFactura.Text;
                C.Documento2 = Program.Documento;
                mensaje      = C.RegistrarCompra();
                if (mensaje == "1")
                {
                    for (int x = 0; x < dtgEntrada.Rows.Count; x++)
                    {
                        C.Idcompra   = 0;
                        C.Idproducto = Convert.ToInt32(dtgEntrada.Rows[x].Cells[0].Value);
                        C.Idalmacen  = Convert.ToInt32(dtgEntrada.Rows[x].Cells[2].Value);
                        C.Idunidad   = Convert.ToInt32(dtgEntrada.Rows[x].Cells[3].Value);
                        C.Cantidad   = Convert.ToDouble(dtgEntrada.Rows[x].Cells[5].Value);
                        C.Costo      = Convert.ToDouble(dtgEntrada.Rows[x].Cells[6].Value);
                        C.Importe    = Convert.ToDouble(dtgEntrada.Rows[x].Cells[7].Value);
                        C.Itbis      = Convert.ToDouble(dtgEntrada.Rows[x].Cells[9].Value);
                        mensaje      = C.RegistrarDetalleCompra();
                    }
                    if (mensaje == "1")
                    {
                        MessageBoxEx.Show("Registrado con éxito", "FactSYS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        dtgEntrada.Rows.Clear();
                        Cp.Idcompra  = Program.Idtransaccion;
                        Cp.Monto     = total1;
                        Cp.Documento = Program.Documento;
                        Cp.Registrar();
                        Limpiar();
                        Autocompletar();
                        frmReporte obj = new frmReporte();
                        obj.Valor    = 2;
                        obj.Reporte  = "compra.rdlc";
                        obj.Idcompra = Program.Idtransaccion;
                        obj.Show();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #7
0
        internal static ReportViewer reportesParaPanel(string nombreReporte, string tablaDataSet, object[] objeto, string mensaje, bool imprimir = false, object[] parametros = null, bool esPdf = false, string nombreArchivo = "", string subcarpeta = "")
        {
            frmReporte reporte = new frmReporte(nombreReporte, subcarpeta, tablaDataSet);


            reporte.setParametrosExtra(esPdf, nombreArchivo);
            reporte.cargarDatos(tablaDataSet, objeto, mensaje, imprimir, parametros);
            return(reporte.reportViewer1);
        }
Beispiel #8
0
 private void MostrarReporte(DataTable dt)
 {
     using (var reporte = new InformeEconómico())
     {
         string título    = this.Text;
         var    subTítulo = "Ciclo Lectivo " + cbCicloLectivo.Text;
         reporte.Database.Tables["InformeEconomico"].SetDataSource(dt);
         using (var f = new frmReporte(reporte, título, subTítulo)) f.ShowDialog();
     }
 }
        public static byte[] reportes(string nombreReporte, string tablaDataSet, object[] objeto, string mensaje = "", bool imprimir = false, object[] parametros = null, bool espdf = false, string nombrePdf = "", string subcarpeta = "")

        {
            frmReporte reporte = new frmReporte(nombreReporte, subcarpeta, tablaDataSet);


            reporte.setParametrosExtra(espdf, nombrePdf);
            reporte.cargarDatos(tablaDataSet, objeto, mensaje, imprimir, parametros);

            return(reporte.bytes);
        }
        private void btnRegistrar_Click(object sender, EventArgs e)
        {
            string mensaje = "";

            try
            {
                if (dtgProducto.Rows.Count > 0 && dtgProveedor.Rows.Count > 0)
                {
                    C.Documento  = txtDocumento.Text;
                    C.Nota       = txtNota.Text;
                    C.Idtercero  = Convert.ToInt32(dtgProveedor.Rows[0].Cells[1].Value);
                    C.Fecha      = dtpFecha.Value;
                    C.Idusuario  = Program.Idusuario;
                    C.Idsucursal = Program.Idsucursal;
                    C.Idmoneda   = Convert.ToInt32(cbMoneda.SelectedValue);
                    C.Idtipo     = 14;
                    C.Factura    = txtFactura.Text;
                    mensaje      = C.RegistrarDevolucion();
                    if (mensaje == "1")
                    {
                        for (int x = 0; x < dtgProducto.Rows.Count; x++)
                        {
                            C.Iddevolucion = 0;
                            C.Idproducto   = Convert.ToInt32(dtgProducto.Rows[x].Cells[1].Value);
                            C.Idunidad     = Convert.ToInt32(dtgProducto.Rows[x].Cells[3].Value);
                            C.Cantidad     = Convert.ToDouble(dtgProducto.Rows[x].Cells[5].Value);
                            C.Costo        = Convert.ToDouble(dtgProducto.Rows[x].Cells[6].Value);
                            C.Importe      = Convert.ToDouble(dtgProducto.Rows[x].Cells[8].Value);
                            C.Itbis        = Convert.ToDouble(dtgProducto.Rows[x].Cells[7].Value);
                            C.Idalmacen    = Convert.ToInt32(dtgProducto.Rows[x].Cells[9].Value);
                            mensaje        = C.RegistrarDetalleDevolucion();
                        }
                        if (mensaje == "1")
                        {
                            MessageBoxEx.Show("Registrado con éxito", "FactSYS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            dtgProducto.Rows.Clear();
                            dtgProveedor.Rows.Clear();
                            txtNota.Clear();
                            txtFactura.Clear();
                            Autocompletar();
                            frmReporte obj = new frmReporte();
                            obj.Valor        = 3;
                            obj.Reporte      = "devolucion_compra.rdlc";
                            obj.Iddevolucion = Program.Iddevolucion;
                            obj.Show();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(ex.Message);
            }
        }
Beispiel #11
0
        private void MostrarReporte(DataTable dt)
        {
            using (var reporte = new InformeFinanciero())
            {
                string título    = this.Text;
                string período   = String.Format("Desde {0:dd/MM/yy} al {1:dd/MM/yy} ", dtDesde.Value.Date, dtHasta.Value.Date);
                var    subTítulo = período;

                reporte.Database.Tables["InformeFinanciero"].SetDataSource(dt);
                using (var f = new frmReporte(reporte, título, subTítulo)) f.ShowDialog();
            }
        }
Beispiel #12
0
 private void MostrarReporte(DataTable detalles, string dirección, string razónSocial, string documento,
                             string tipoDocumento, string comprobante, string número, string fecha,
                             string subtotal, string descuento, string total, string validez)
 {
     using (var reporte = new Presupuesto())
     {
         reporte.Database.Tables["Detalles"].SetDataSource(detalles);
         using (
             var f = new frmReporte(reporte, dirección, razónSocial, documento,
                                    tipoDocumento, comprobante, número, fecha,
                                    subtotal, descuento, total, validez)) f.ShowDialog();
     }
 }
 private void MostrarReporte(DataTable dt)
 {
     using (var reporte = new InscripciónExamen())
     {
         string título = "";
         if (_cuotasimpagas <= 0)
         {
             título = "Solicitud de Inscripción";
         }
         if (_cuotasimpagas > 0)
         {
             título = "Solicitud de Inscripción - Con Excepción";
         }
         reporte.Database.Tables["PermisoExamen"].SetDataSource(dt);
         using (var f = new frmReporte(reporte, título)) f.ShowDialog();
     }
 }
Beispiel #14
0
 private void MostrarReporte(DataTable dt)
 {
     using (var reporte = new AlumnosPorEstado())
     {
         string título = "Alumnos por Estado";
         string curso  = cbCursos.Text;
         if (IdCurso == 0)
         {
             curso = curso.Replace("(", "").Replace(")", "");
         }
         string carrera = cbCarreras.Text;
         if (IdCarrera == 0)
         {
             carrera = carrera.Replace("(", "").Replace(")", "");
         }
         var subTítulo = curso + " - " + carrera;
         reporte.Database.Tables["EstadoAlumno"].SetDataSource(dt);
         using (var f = new frmReporte(reporte, título, subTítulo)) f.ShowDialog();
     }
 }
 private void MostrarReporte(DataTable dt)
 {
     using (var reporte = new AlumnosMorosos())
     {
         string título = cbTipo.Text;
         string fecha  = "Al " + dtFecha.Value.Date.ToString("dd/MM/yyyy");
         string curso  = cbCursos.Text;
         if (IdCurso == 0)
         {
             curso = curso.Replace("(", "").Replace(")", "");
         }
         string carrera = cbCarreras.Text;
         if (IdCarrera == 0)
         {
             carrera = carrera.Replace("(", "").Replace(")", "");
         }
         var subTítulo = fecha + " - " + curso + " - " + carrera;
         reporte.Database.Tables["AlumnoMoroso"].SetDataSource(dt);
         using (var f = new frmReporte(reporte, título, subTítulo)) f.ShowDialog();
     }
 }
Beispiel #16
0
 private void MostrarReporte(DataTable dt)
 {
     //using (var reporte = new TotalPagos())
     using (var reporte = new TotalesPago())
     {
         string título  = this.Text;
         string período = String.Format("Desde {0:dd/MM/yy} al {1:dd/MM/yy} ", dtDesde.Value.Date, dtHasta.Value.Date);
         string curso   = cbCursos.Text;
         if (IdCurso == 0)
         {
             curso = curso.Replace("(", "").Replace(")", "");
         }
         string carrera = cbCarreras.Text;
         if (IdCarrera == 0)
         {
             carrera = carrera.Replace("(", "").Replace(")", "");
         }
         var subTítulo = período + " - " + curso + " - " + carrera;
         reporte.Database.Tables["TotalPago"].SetDataSource(dt);
         using (var f = new frmReporte(reporte, título, subTítulo)) f.ShowDialog();
     }
 }
Beispiel #17
0
        private void button3_Click(object sender, EventArgs e)
        {
            var report = new frmReporte();

            report.ShowDialog();
        }
Beispiel #18
0
        private void btnGenerar_Click(object sender, EventArgs e)
        {
            try
            {
                if (cbEntidad.SelectedIndex == -1)
                {
                    MessageBoxEx.Show("Debe seleccionar una entidad", "FactSYS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    frmReporte obj = new frmReporte();
                    if (listBox2.Items.Count > 0)
                    {
                        obj.Orden1 = listBox2.Items[0].ToString();
                    }
                    else
                    {
                        obj.Orden1 = "0";
                    }
                    if (listBox2.Items.Count >= 2)
                    {
                        obj.Orden2 = listBox2.Items[1].ToString();
                    }
                    else
                    {
                        obj.Orden2 = "0";
                    }

                    if (listBox2.Items.Count >= 3)
                    {
                        obj.Orden3 = listBox2.Items[2].ToString();
                    }
                    else
                    {
                        obj.Orden3 = "0";
                    }
                    if (listBox2.Items.Count >= 4)
                    {
                        obj.Orden4 = listBox2.Items[3].ToString();
                    }
                    else
                    {
                        obj.Orden4 = "0";
                    }
                    if (listBox2.Items.Count >= 5)
                    {
                        obj.Orden5 = listBox2.Items[4].ToString();
                    }
                    else
                    {
                        obj.Orden5 = "0";
                    }

                    if (cbEntidad.SelectedIndex == 0)
                    {
                        obj.Valor   = 4;
                        obj.Reporte = "listado_empleados.rdlc";
                    }
                    if (cbEntidad.SelectedIndex == 1)
                    {
                        obj.Valor   = 5;
                        obj.Reporte = "listado_proveedores.rdlc";
                    }
                    if (cbEntidad.SelectedIndex == 2)
                    {
                        obj.Valor   = 6;
                        obj.Reporte = "listado_clientes.rdlc";
                    }
                    if (cbEntidad.SelectedIndex == 3)
                    {
                        obj.Valor   = 7;
                        obj.Reporte = "listado_productos.rdlc";
                    }
                    obj.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #19
0
        private void btnRegistrar_Click(object sender, EventArgs e)
        {
            try
            {
                errorProvider1.Clear();
                if (Utilidades.ValidarForm(this, errorProvider1) == false)
                {
                    return;
                }
                string    mensaje = "";
                DataTable dt      = new DataTable();
                if (dtgFacturacion.Rows.Count > 0)
                {
                    F.Fecha      = dtpFecha.Value;
                    F.Documento  = txtDocumento.Text;
                    F.Nota       = txtNota.Text;
                    F.Idcaja     = Convert.ToInt16(txtCaja.Text);
                    F.Idusuario  = Program.Idusuario;
                    F.Idmoneda   = Convert.ToInt16(cbMoneda.SelectedValue);
                    F.Idtipof    = Convert.ToInt16(cbTipoF.SelectedValue);
                    F.Idmetodop  = Convert.ToInt16(cbMetodop.SelectedValue);
                    F.Idcliente  = Convert.ToInt16(txtCodigoCliente.Text);
                    F.Idsucursal = Program.Idsucursal;
                    mensaje      = F.RegistrarFactura();
                    if (mensaje == "1")
                    {
                        for (int x = 0; x < dtgFacturacion.Rows.Count; x++)
                        {
                            A.Idproducto = Convert.ToInt16(dtgFacturacion.Rows[x].Cells[1].Value);
                            dt           = A.AlmacenesProductos();
                            F.Idfactura  = Program.Idfactura;
                            F.Idproducto = Convert.ToInt32(dtgFacturacion.Rows[x].Cells[1].Value);
                            F.Idalmacen  = Convert.ToInt32(dt.Rows[0][0]);
                            F.Idunidad   = Convert.ToInt32(dtgFacturacion.Rows[x].Cells[3].Value);
                            F.Cantidad   = Convert.ToDouble(dtgFacturacion.Rows[x].Cells[2].Value);
                            F.Precio     = Convert.ToDouble(dtgFacturacion.Rows[x].Cells[6].Value);
                            F.Importe    = Convert.ToDouble(dtgFacturacion.Rows[x].Cells[7].Value);
                            F.Itbis      = Convert.ToDouble(dtgFacturacion.Rows[x].Cells[8].Value);
                            mensaje      = F.RegistrarDetalleFactura();
                            dt.Rows.Clear();
                        }
                        if (mensaje == "1")
                        {
                            MessageBoxEx.Show("Registrado con éxito", "FactSYS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            dtgFacturacion.Rows.Clear();
                            Limpiar();
                            txtNota.Clear();
                            if (chbNCF.Checked == true)
                            {
                                N.Tipocf    = "2";
                                N.Secuencia = Program.Ncf;
                                N.ActualizarSecuencia();
                            }

                            chbNCF.Checked = false;
                            if (cbTipoF.Text == "Credito")
                            {
                                Cc.Idcliente = Convert.ToInt16(txtCodigoCliente.Text);
                                Cc.Idfactura = Program.Idfactura;
                                Cc.Monto     = total1;
                                Cc.Registrar();
                            }
                            else
                            {
                                C.Idcaja    = Convert.ToInt16(txtCaja.Text);
                                C.Idusuario = Program.Idusuario;
                                C.Monto     = total1;
                                C.Tipo      = Convert.ToInt16(cbMetodop.SelectedValue);
                                C.Idmoneda  = Convert.ToInt16(cbMoneda.SelectedValue);
                                C.RegistrarActualizarCuadreCaja();
                            }
                            txtCodigoCliente.Clear();
                            txtCliente.Clear();
                            frmReporte obj = new frmReporte();
                            obj.Valor     = 8;
                            obj.Reporte   = "factura.rdlc";
                            obj.Idfactura = Program.Idfactura;
                            lbTotal.Text  = "0.00";
                            Autocompletar();
                            obj.ShowDialog();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }