Favor Ayuda para imprimir Campo MEMO RTF con PRINT

Favor Ayuda para imprimir Campo MEMO RTF con PRINT

Postby remtec » Tue Jul 26, 2022 2:08 am

Hola Amigos

Sigo molestando.

Necesito que los Gurus, me puedan hacer el favor de ayudarme como siempre lo han hecho.

Tengo un detalle de informacion guadada en un campo memo de una DBF con texto RTF "RichEdi5", el cual debo imprimir en un documento junto a otros datos con la opcion PRINT.

La verdad que no he encontrado la forma de poder lograrlo.

En espera de su ayuda.

Muchas gracias y muchos saludos.

Antonio

Dejo El codigo indicado donde debo insertar el contenido del campo MEMO:
Code: Select all  Expand view


                        PRINT oPrn NAME "Examen PRUEBA IMPRIMIR " PREVIEW MODAL //FILE cPdfFile
                         If Empty( oPrn:hDC )
                               MsgStop( "Su Impresora no Esta En Linea" )
                               return nil
                         Endif

                           DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-20 BOLD OF oPrn
                           DEFINE FONT oFont1 NAME "TAHOMA" SIZE 0,-14  OF oPrn
                           DEFINE FONT oFont2 NAME "TAHOMA" SIZE 0,-12  OF oPrn
                           DEFINE FONT oFont3 NAME "TAHOMA" SIZE 0,-16 BOLD OF oPrn
                           DEFINE FONT oFont4 NAME "TAHOMA" SIZE 0,-18 BOLD OF oPrn
                           DEFINE FONT oFont5 NAME "TAHOMA" SIZE 0,-14 BOLD OF oPrn
                           DEFINE FONT oFont6 NAME "TAHOMA" SIZE 0,-12 BOLD OF oPrn

                                    //
                           nHeight := oPrn:GetTextHeight( "", oFont ) // value for proper line feeds
                           oPrn:Pix2Units( nil, nil, nil, @nHeight, "MM" )

                           nHeight *= 1.2
                           PAGE
                              nRow := 0 // MM

                              nRow  += nHeight
                              @ 10, 10 PRINT TO oPrn IMAGE cBmp SIZE 39.5, 24 MM

                              nRow  += 24
                              oPrn:Say( 10, 95, "TITULO SEGUNDARIO", oFont4,NIL, CLR_BLUE, NIL, NIL, "MM"  )
                              oPrn:Say( 18, 85, "    Direccion  ", oFont1,NIL, CLR_BLUE, NIL, NIL, "MM"  )
                              oPrn:Say( 23, 85, "Fonos:xxxxxx xxxxxxx xxxxxxxx", oFont1,NIL, CLR_BLUE, NIL, NIL, "MM"  )
                              oPrn:Say( 27, 85, "                  www.prueba.com                   ", oFont1,NIL, CLR_BLUE, NIL, NIL, "MM"  )

                                         oPrn:Say( 35, 135, "CERTIFICADO Nº:"+AllTrim(Str(b->Nro_Cer,10)), oFont2,NIL, CLR_BLACK, NIL, NIL, "MM"  )

                                         oPrn:RoundBox( 1.6    , 0.8      , 1.9   , 8.00   , 0.1  , 0.1, oPen, RGB(100, 149, 237), ;
                               { Spac(12)+"EXAMEN PRUEBA", oFont3, CLR_BLACK }, "INCHES" )

                                         oPrn:Box( 2.0, 0.80, 2.9, 7.92,,,, "INCHES" )
                                         oPrn:Say( 52, 25, "NOMBRE", oFont6,NIL, NIL, NIL, NIL, "MM"  )
                                         oPrn:Say( 57, 25, "R.U.T.", oFont6,NIL, NIL, NIL, NIL, "MM"  )
                                         oPrn:Say( 62, 25, "EDAD", oFont6,NIL, NIL, NIL, NIL, "MM"  )
                                         oPrn:Say( 62, 87, "AÑOS", oFont6,NIL, NIL, NIL, NIL, "MM"  )
                                         oPrn:Say( 67, 25, "NACIONALIDAD", oFont6,NIL, NIL, NIL, NIL, "MM"  )

                                         oPrn:Box( 2.0, 2.50, 2.9, 2.505,,,, "INCHES" )  // Pongo lineas paralelas para generar el efecto tabla

                                         // Imprimo Datos Variables
                                         oPrn:Say( 52, 68, b->Nom_Pac, oFont6,NIL, NIL, NIL, NIL, "MM"  )
                                         oPrn:Say( 57, 68, b->Rut_Pac, oFont6,NIL, NIL, NIL, NIL, "MM"  )
                                         oPrn:Say( 62, 68, Transform(Round(b->Eda_Pac,0), "@E 999"), oFont6,NIL, NIL, NIL, NIL, "MM"  )
                                         oPrn:Say( 67, 68, b->Nac_Pac, oFont6,NIL, NIL, NIL, NIL, "MM"  )


                                        // Texto
                                         oPrn:Say( 75, 20, cText1, oFont1, NIL, NIL, NIL, NIL, "MM" )
                                         oPrn:Say( 80, 20, cText2, oFont1, NIL, NIL, NIL, NIL, "MM" )
                                         oPrn:Say( 85, 20, cText3, oFont1, NIL, NIL, NIL, NIL, "MM" )

                                        // NOTA: AQUI DEBO INSERTAE EL DETALLE QUE SE ENCUENTRA EN EL CAMPO MEMO Det_Exa, con formato RICHEDIT5

                                          Abre_dbf("TipExa",8,.f.,"")
                                            Set Inde to TipExa
                                            Seek b->Tip_Ate

                                            //  Aqui Debo obtener el valor del campo MEMO con texto RTF "RICHEDIT5" e Imprimirlo


                                 */
                                         If b->Eva_Med=='A'
                                                oPrn:Say( 191, 98, "APROBADA", oFont5,NIL, NIL, NIL, NIL, "MM"  )
                                         Else
                                                oPrn:Say( 191, 98, "REPROBADA", oFont5,NIL, NIL, NIL, NIL, "MM"  )
                                         Endif






                                         oPrn:Say( 203, 20, "Fecha de Emisión: "+b->Fec_Inf, oFont2,NIL, NIL, NIL, NIL, "MM"  )
                                         oPrn:Say( 208, 20, "Vigencia del Informe: 1 año a contar de la fecha de emisión", oFont2,NIL, NIL, NIL, NIL, "MM"  )

                                         // Imprime Dato

                                        // Imprimo Firma
                              @ 210, 110 PRINT TO oPrn IMAGE cFirma SIZE 39.5, 24 MM

                                         oPrn:Say( 230,100, "_____________________________________", oFont2,NIL, NIL, NIL, NIL, "MM"  )
                                         oPrn:Say( 235,100, a->Nom_Pro, oFont2,NIL, NIL, NIL, NIL, "MM"  )
                                         oPrn:Say( 240,100, "R.u.t. "+a->Rut_Pro+" / "+a->Reg_Med, oFont2,NIL, NIL, NIL, NIL, "MM"  )
                                         oPrn:Say( 245,100, a->Esp_Med, oFont2,NIL, NIL, NIL, NIL, "MM"  )
                                         oPrn:Say( 250,100, a->Uni_Pro, oFont2,NIL, NIL, NIL, NIL, "MM"  )


                              ENDPAGE
                        ENDPRINT

 
FWH 22.10 - HARBOUR - PELLES C
remtec
 
Posts: 717
Joined: Fri May 12, 2017 2:50 pm

Re: Favor Ayuda para imprimir Campo MEMO RTF con PRINT

Postby cmsoft » Tue Jul 26, 2022 3:08 am

Simplemente en las coordenadas que quieras pones el texto
Code: Select all  Expand view

@ 86, 20 PRINT TO oPrn TEXT b->camportf SIZE 1900,200 MM
 
User avatar
cmsoft
 
Posts: 1189
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Favor Ayuda para imprimir Campo MEMO RTF con PRINT

Postby remtec » Tue Jul 26, 2022 2:42 pm

Buen dia Amigo Cesar.

Como estas?

Muchas gracias por responder.

Lamentablemente al aplicar tu sugerencia, no tengo control del largo de las líneas, me explico, si tienes una párrafo de 5 líneas cuando lo grabo, este lo imprime en una línea larga, que desborda el ancho de la hoja, finalmente es cortado cuando encuentra un punto a parte o pto. final.

A lo anterior, debo agregar, que el espacio entre líneas, es prácticamente a doble espacio.

Como podría imprimir este contenido en la forma que se encuentra grabado y a una interlinea normal.

Muchos Saludos

Antonio
FWH 22.10 - HARBOUR - PELLES C
remtec
 
Posts: 717
Joined: Fri May 12, 2017 2:50 pm

Re: Favor Ayuda para imprimir Campo MEMO RTF con PRINT

Postby cnavarro » Tue Jul 26, 2022 2:46 pm

Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Favor Ayuda para imprimir Campo MEMO RTF con PRINT

Postby remtec » Tue Jul 26, 2022 2:59 pm


Hola Cristobal

Como estas?

Muchas gracias por responder.

Estaba un poco mareado, recien habia encontrado el link que me indicas, me encontraba probandolo.

Amigo Cesar.

Tu Linea: @ 86, 20 PRINT TO oPrn TEXT h->Det_Exa SIZE 1900,200 MM

Line Aplicada: @ 6,1 PRINT TO oPrn TEXT h->Det_Exa SIZE 6,4 INCHES FONT oFont2 ( Esta funciona)

Las medidas "SIZE 6,4 INCHES" y "SIZE 1900,200 MM", genera la diferencia de SIZE 1900,200 MM.


Mil disculpas.

Saludos
Antonio
FWH 22.10 - HARBOUR - PELLES C
remtec
 
Posts: 717
Joined: Fri May 12, 2017 2:50 pm

Re: Favor Ayuda para imprimir Campo MEMO RTF con PRINT

Postby cmsoft » Tue Jul 26, 2022 7:31 pm

Me alegro que haya servido Antonio
User avatar
cmsoft
 
Posts: 1189
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 86 guests