Ejemplo n.º 1
0
        public void ContruirVistaPrevia(Dictionary <int, Orden> ordenes)
        {
            LogicaExamen oLExamen = new LogicaExamen();

            sector = new Sector();

            PrintDocument pd = new PrintDocument();

            pd.DefaultPageSettings.PaperSize        = new PaperSize("A4", 827, 1169);
            sector.Configuracion.TamañoPapel.Width  = pd.DefaultPageSettings.PaperSize.Width;
            sector.Configuracion.TamañoPapel.Height = pd.DefaultPageSettings.PaperSize.Height;
            sector.Configuracion.Margen             = new Padding(5, 5, 5, 40);

            FormatoImpresion        formato;
            List <FormatoImpresion> formatos = new List <FormatoImpresion>();

            foreach (Orden orden in ordenes.Values)
            {
                formato = ConstructorFicha.GetInstance().CrearAllDocumento(oLExamen.RecuperarExamenes(orden), orden, 7.5f, sector.Configuracion.TamañoPapel);
                formatos.Add(formato);
            }
            buffer = new BufferImpresion(formatos);

            PrintDialog printdia = new PrintDialog();

            printdia.Document = pd;

            if (printdia.ShowDialog() == DialogResult.OK)
            {
                pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);
                pd.Print();
            }
        }
Ejemplo n.º 2
0
        public void ContruirVistaPreviaExamenPaciente(Orden orden, Dictionary <int, Examen> examenes)
        {
            sector = new Sector();

            PrintDocument pd = new PrintDocument();

            pd.DefaultPageSettings.PaperSize        = new PaperSize("A4", 827, 1169);
            sector.Configuracion.TamañoPapel.Width  = pd.DefaultPageSettings.PaperSize.Width;
            sector.Configuracion.TamañoPapel.Height = pd.DefaultPageSettings.PaperSize.Height;
            pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);

            FormatoImpresion        formato;
            List <FormatoImpresion> formatos = new List <FormatoImpresion>();

            formato = ConstructorFicha.GetInstance().CrearAllDocumento(examenes, orden, 7.5f, sector.Configuracion.TamañoPapel);
            formatos.Add(formato);

            buffer = new BufferImpresion(formatos);
        }