Пример #1
0
        private void Imprimir()
        {
            var pt = AppDomain.CurrentDomain.BaseDirectory + @"Helpers\Imprimir\Grafico\Cuadre.rdlc";
            var ds = new ds();

            DataRow N = ds.Tables["CuadreCaja"].NewRow();

            N["cntFac"]            = _ds.cntFAC;
            N["cntNCR"]            = _ds.cntNCR;
            N["cntNEN"]            = _ds.cntNEN;
            N["cntFacAnu"]         = _ds.cntFACAnu;
            N["cntNCRAnu"]         = _ds.cntNCRAnu;
            N["cntNENAnu"]         = _ds.cntNENAnu;
            N["montoFac"]          = _ds.montoFAC;
            N["montoFacAnu"]       = _ds.montoFACAnu;
            N["montoNCR"]          = _ds.montoNCR;
            N["montoNCRAnu"]       = _ds.montoNCRAnu;
            N["montoNEN"]          = _ds.montoNEN;
            N["montoNENAnu"]       = _ds.montoNENAnu;
            N["montoVenta"]        = _ds.montoVenta;
            N["montoVentaContado"] = _ds.montoVentaContado;
            N["montoVentaCredito"] = _ds.montoVentaCredito;
            N["efectivo_s"]        = _ds.efectivo_s;
            N["divisa_s"]          = _ds.divisa_s;
            N["electronico_s"]     = _ds.electronico_s;
            N["otros_s"]           = _ds.otros_s;
            N["devolucion_s"]      = _ds.devoluciones_s;
            N["credito_s"]         = _ds.credito_s;
            N["cambio_s"]          = _ds.cambio_s;
            N["efectivo_u"]        = _ds.efectivo_u;
            N["divisa_u"]          = _ds.divisa_u;
            N["electronico_u"]     = _ds.electronico_u;
            N["otros_u"]           = _ds.otros_u;
            N["cnt_efectivo_s"]    = _ds.cnt_efectivo_s;
            N["cnt_divisa_s"]      = _ds.cnt_divisa_s;
            N["cnt_electronico_s"] = _ds.cnt_electronico_s;
            N["cnt_otros_s"]       = _ds.cnt_otros_s;
            N["cnt_divisa_u"]      = _ds.cnt_divisa_u;
            N["cuadre_s"]          = _ds.cuadre_s;
            N["cuadre_u"]          = _ds.cuadre_u;
            ds.Tables["CuadreCaja"].Rows.Add(N);

            var Rds = new List <ReportDataSource>();
            var pmt = new List <ReportParameter>();

            Rds.Add(new ReportDataSource("CuadreCaja", ds.Tables["CuadreCaja"]));

            var frp = new ReporteFrm();

            frp.rds   = Rds;
            frp.prmts = pmt;
            frp.Path  = pt;
            frp.ShowDialog();
        }
Пример #2
0
        private void Imprimir()
        {
            var pt     = AppDomain.CurrentDomain.BaseDirectory + @"Helpers\Imprimir\Grafico\Documento.rdlc";
            var ds     = new ds();
            var factor = _ds.encabezado.FactorCambio;

            //NEGOCIO
            DataRow N = ds.Tables["DatosNegocio"].NewRow();

            N["Nombre"]    = _ds.negocio.Nombre;
            N["CiRif"]     = _ds.negocio.CiRif;
            N["Direccion"] = _ds.negocio.Direccion;
            ds.Tables["DatosNegocio"].Rows.Add(N);

            //ENCABEZADO
            DataRow E = ds.Tables["Encabezado"].NewRow();

            E["NombreCli"]    = _ds.encabezado.NombreCli;
            E["DireccionCli"] = _ds.encabezado.DireccionCli;
            E["CiRifCli"]     = _ds.encabezado.CiRifCli;
            E["CodigoCli"]    = _ds.encabezado.CodigoCli;
            E["DocNombre"]    = _ds.encabezado.DocumentoNombre;
            E["DocNro"]       = _ds.encabezado.DocumentoNro;
            E["DocFecha"]     = _ds.encabezado.DocumentoFecha;
            E["SubTotal"]     = _ds.encabezado.SubTotalItemFull;
            E["Descuento"]    = _ds.encabezado.Descuento;
            E["Total"]        = _ds.encabezado.Total;
            E["TotalDivisa"]  = _ds.encabezado.TotalDivisa;
            ds.Tables["Encabezado"].Rows.Add(E);

            //ITEMS
            foreach (var rg in _ds.item)
            {
                DataRow p = ds.Tables["Item"].NewRow();
                p["NombrePrd"]     = rg.NombrePrd;
                p["CodigoPrd"]     = rg.CodigoPrd;
                p["Cantidad"]      = rg.Cantidad;
                p["Empaque"]       = rg.Empaque + Environment.NewLine + "( " + rg.Contenido.ToString().Trim() + " )";
                p["Deposito"]      = rg.DepositoDesc;
                p["Precio"]        = rg.PrecioFull;
                p["PrecioDivisa"]  = rg.PrecioFull / factor;
                p["Importe"]       = rg.ImporteFull;
                p["ImporteDivisa"] = rg.ImporteDivisa / factor;
                p["TotalUnd"]      = rg.TotalUnd;
                ds.Tables["Item"].Rows.Add(p);
            }

            var Rds = new List <ReportDataSource>();
            var pmt = new List <ReportParameter>();

            Rds.Add(new ReportDataSource("DatosNegocio", ds.Tables["DatosNegocio"]));
            Rds.Add(new ReportDataSource("Encabezado", ds.Tables["Encabezado"]));
            Rds.Add(new ReportDataSource("Item", ds.Tables["Item"]));

            var frp = new ReporteFrm();

            frp.rds   = Rds;
            frp.prmts = pmt;
            frp.Path  = pt;
            frp.ShowDialog();
        }