Exemplo n.º 1
0
        private void IrAPaginaTicket()
        {
            navFrameMenuInicial.SelectedPage = navPageTicket;

            rpt = new rptTicket();
            rpt.CargarDatos(Pro_Ticket_Generado, Pro_Conexion);
            rpt.pic_Logo.Image        = Image.FromFile(ConfigurationSettings.AppSettings["RUTA_LOGO_INSTITUCION"]);
            rpt.lblNombreAgencia.Text = Pro_NombreAgenciaServicio;


            try
            {
                splashScreenManager1.ShowWaitForm();
                rpt.CreateDocument();
                documentViewer1.DocumentSource = rpt;

                splashScreenManager1.CloseWaitForm();


                tmrTiempoVisualizacionTicket.Start();
                ReportPrintTool v_print_tool = new ReportPrintTool(rpt);
                v_print_tool.Print(ConfigurationSettings.AppSettings["IMPRESORA_TICKETS"]);
            }
            catch (Exception Exc)
            {
                MessageBox.Show(Exc.Message, "FLUCOL");
            }
        }
Exemplo n.º 2
0
        private void gdvListado_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.ColumnIndex == this.gdvListado.Columns["Detalle"].Index)
                {
                    int    idventa = Convert.ToInt32(gdvListado.SelectedCells[1].Value);
                    string total   = Convert.ToString(gdvListado.SelectedCells[7].Value);

                    string textoNumero = NumeroATexto(total);

                    ParametrosReporte reporte = DatVenta.Consultar_Ticket_Parametro(idventa);
                    reporte.LetraNumero = textoNumero;


                    if (rbTicket.Checked == true)
                    {
                        rptTicket rptTicket = new rptTicket();
                        rptTicket.tbTicket.DataSource = reporte.lstDetalleVenta;
                        rptTicket.DataSource          = reporte;
                        reportViewer1.Report          = rptTicket;
                    }
                    else if (RbtnMod2.Checked)
                    {
                        ReportTicket rptTicket = new ReportTicket();
                        rptTicket.tbTicket.DataSource = reporte.lstDetalleVenta;
                        rptTicket.DataSource          = reporte;
                        reportViewer1.Report          = rptTicket;
                    }
                    else
                    {
                        rtpRecibo recibo = new rtpRecibo();
                        recibo.tblVentaProducto.DataSource = reporte.lstDetalleVenta;
                        recibo.DataSource    = reporte;
                        reportViewer1.Report = recibo;
                    }

                    reportViewer1.RefreshReport();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error de al intentar obtener el ticket " + ex.Message, "Error de lectura", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }