Page 1 of 1

TReport: como hacer que los TOTALES se impriman al final

PostPosted: Tue Nov 24, 2015 2:16 am
by RSalazarU
Hola amigos del foro:

Habra alguna forma de hacer que TReport imprima los totales siempre al final del espacio de impresion (una linea antes del FOOTER)
Ejemplo:
Ahora imprime así
Code: Select all  Expand view

---------------------------------------
|CANT  |DETALLE              |  VALOR |
---------------------------------------
|  10  |DETALLE              |    100 |
|  20  |DETALLE              |    200 |
---------------------------------------
|      TOTAL                 |    300 |
---------------------------------------
 

Como imprimo así
Code: Select all  Expand view

---------------------------------------
|CANT  |DETALLE              |  VALOR |
---------------------------------------
|  10  |DETALLE              |    100 |
|  20  |DETALLE              |    200 |
|      |                     |        |
|      |                     |        |
|      |                     |        |
|      |                     |        |
---------------------------------------
|      TOTAL                 |    300 |
---------------------------------------
 


De antemano, muchas gracias por la ayuda.

Rolando
Cochabamba, Bolivia

Re: TReport: como obligar a que los TOTALES se impriman al final

PostPosted: Tue Nov 24, 2015 2:31 pm
by karinha
Code: Select all  Expand view

#include "FiveWin.ch"
#include "report.ch"

STATIC oReport

Function Rep17()

     USE TEST2 NEW // VIA "DBFCDX"

     REPORT oReport ;
          TITLE  "*** Fivewin Report ***"  ;
          PREVIEW

     COLUMN TITLE "St" DATA TEST2->State

     COLUMN TITLE "First Name", "Last Name" ;
            DATA  TEST2->First, TEST2->Last

     COLUMN TITLE "Street", "City"  ;
            DATA  TEST2->Street, TEST2->City

     COLUMN TITLE "   Salary"  ;
            DATA  TEST2->Salary ;
            TOTAL

     END REPORT

     /*
     In Spanish
     */


     /*
     Descriptions for page total and grand total
     */


     oReport:cPageTotal := "Page Total..."
     oReport:cGrandTotal := "Total General..."

     /*
     No Up line on column titles
     */


     oReport:nTitleUpLine := RPT_NOLINE

     /*
     Single total lines
     */


     oReport:nTotalLine := RPT_SINGLELINE

     /*
     Left margin at 1 inch
     */


     oReport:Margin(1, RPT_LEFT, RPT_INCHES)

     ACTIVATE REPORT oReport

     CLOSE TEST2

RETURN NIL
 



(SOLUCIONADO)

PostPosted: Tue Nov 24, 2015 5:39 pm
by RSalazarU
Modifique la clase TReport()

Añadi la siguiente DATA
Code: Select all  Expand view

   DATA lColComplete INIT .F.
 


y en el metodo EndPage()
Code: Select all  Expand view

METHOD EndPage() CLASS TReport

   static lRunning := .f.

   if ::lColComplete .and. ! ::lBreak .and. ::lFinish
      do while ::nRow < ::nLastdRow                      
         ::StartLine( if( ( ::nRow + ::nStdLineHeight ) >= ::nBottomRow, ::nBottomRow - ::nRow -1, ::nStdLineHeight) )
         ::nRow += if( ( ::nRow + ::nStdLineHeight ) >= ::nBottomRow, ::nBottomRow - ::nRow -1, ::nStdLineHeight)    
      enddo  
   endif      

   if ::bEndPage != nil .and. !lRunning
 


Prove con varias reportes: Facturas, Notas de venta, etc., y funciona bien.

Image

Rolando
Cochabamba, Bolivia

Re: TReport: como hacer que los TOTALES se impriman al final

PostPosted: Wed Nov 25, 2015 8:57 pm
by Silvio.Falconi
How you user treport to create a factura ?
Can you post a small sample here ?