Page 1 of 1

tReport linea doble para visualizar mas datos

PostPosted: Mon Oct 03, 2022 8:23 pm
by nlerdafehn
Buenas tardes foro,

Estoy teniendo una duda, en la clase tReport, no puedo encontrar como hacer que una linea del reporte sea multiple. Quiero imprimir por una impresora de 80mm y quiero dejar el campo de DETALLE que ocupe toda la linea, y debajo poner el resto de las columnas.

Code: Select all  Expand view

 report rep_per ;
                   font ofont1, ofont, ofont2, FONTIT , ofont3  pen open1;
       header 'CIERRE DE BOLETERIA ',;
       DTOC(DATE())+' a las '+TIME(),;
       'Caja '+ FIELD->CAJA+" - "+field->detalle,;
       '';
       footer 'Pagina :'+str(rep_per:npage,3) center  preview

if rep_per:nWidth < 600
   column title  'Promo'                 data field -> promo size 10     font 2
   column title  'Cant'                  data field -> cantidad total size 3   picture "@e 9,999,999" font 2
   column title  'Importe'               data field -> precio         size 5   picture "@e 9,999,999"  font 2
   column title  'Subtotal'              data field -> subto total    size 5   picture "@e 9,999,999" font 2
else
    column title  'Promo'                 data field -> promo       font 2
    column title  'Cantidad'              data field -> cantidad total   picture "@e 9,999,999" font 2
    column title  'Importe'               data field -> precio      picture "@e 9,999,999"  font 2
    column title  'Subtotal'              data field -> subto total picture "@e 9,999,999" font 2
endif
    end report

    activate report rep_per


Intente poniendo un newline() despues que termina el line y escribiendo los datos a mano, pero tengo problemas a la hora de poner groups y los totales no se muestran bien.

Hay alguna forma? Intente tambien poniendo +CRLF+ pero no funciona. O hay algun on clause para detectar cuando va a escribir un data? Porque si bien lo hice en startline, toma cuando no deberia escribir (espacios para separar grupos)

La idea es la siguiente:

DETALLE | CANT. | IMPORTE | SUBTOTAL
ESTA ES UNA ENTRADA EJEMPLO
1 100 100

Gracias

Re: tReport linea doble para visualizar mas datos

PostPosted: Mon Oct 03, 2022 8:34 pm
by nlerdafehn
Encontre el argumento de MEMO pero hace que entre en la misma columna, hay alguna forma de que use toda la linea?

Re: tReport linea doble para visualizar mas datos

PostPosted: Mon Oct 03, 2022 10:33 pm
by cmsoft
Nicolas:
Creo que esa es la funcionalidad de treport, ordenar por columnas.
Creo que para una impresión más libre, te conviene usar la clase tprinter, pero toda la funcionalidad de sumas y subgrupos la tenés que manejar vos (a mano digamos)
Code: Select all  Expand view

PRINT oPrn PREVIEW
          PAGE    
              nRow := .5
              @ nRow,1.5 PRINT TO oPrn IMAGE "logo.jpg" SIZE 5, 2 CM LASTROW nRow
              @ nRow, 00 PRINT TO oPrn TEXT "CIERRE DE BOLETERIA" ;
                                  SIZE 7.4,.5 CM FONT oFont1 ALIGN "C" LASTROW nRow
              @ nRow, 00 PRINT TO oPrn TEXT DTOC(DATE())+' a las '+TIME() ;
                                  SIZE 7.4,1 CM FONT oFont LASTROW nRow
              @ nRow, 00 PRINT TO oPrn TEXT 'Caja '+ FIELD->CAJA+" - "+field->detalle;
                                  SIZE 7.4,1 CM FONT oFont LASTROW nRow              
              oPrn:CmLine( nRow,0, nRow,9 )              
              nRow := nRow + .2              
              FIELD->(dbgotop())
              DO WHILE !FIELD->(EOF())  
                  nRow1 := nRow
                  @ nRow1,   0 PRINT TO oPrn TEXT field -> promo;
                              SIZE 7.4,1 CM FONT oFont1  ALIGN "L"  LASTROW nRow1
                  @ nRow1, 0 PRINT TO oPrn TEXT STR(field -> cantidad);
                              SIZE 2,.5 CM FONT oFont
                  @ nRow1, 0 PRINT TO oPrn TEXT STR(field -> precio);
                              SIZE 2,.5 CM FONT oFont
                  @ nRow1, 0 PRINT TO oPrn TEXT STR(field -> subtotal);
                              SIZE 2,.5 CM FONT oFont LASTROW nRow
                  FIELD->(DBSKIP())
                 // Aca sumar para hacer subtotales
              ENDDO              
          ENDPAGE
ENDPRINT
 

Espero te sirva

Re: tReport linea doble para visualizar mas datos

PostPosted: Tue Oct 04, 2022 7:50 am
by Manuel Aranda
No sé si he interpretado bien lo que estás buscando.
Para poner varios datos en un misma linea, te pongo ejemplo:
Code: Select all  Expand view

..............
          //
          COLUMN TITLE "Cultivo /","Superficie" ;
          DATA CUADERNO->CULTIVO, STR(CUADERNO->SUPERTRA,8,4)+" Ha." SIZE 9 LEFT GRID
          //

..............

 

Re: tReport linea doble para visualizar mas datos

PostPosted: Tue Oct 04, 2022 4:47 pm
by nlerdafehn
Gracias Manuel y Cesar, me sirve. Intentare ver que resulta. Muchas gracias!!