TReport: como hacer que los TOTALES se impriman al final

TReport: como hacer que los TOTALES se impriman al final

Postby RSalazarU » Tue Nov 24, 2015 2:16 am

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
Last edited by RSalazarU on Tue Nov 24, 2015 5:40 pm, edited 1 time in total.
RSalazarU
 
Posts: 211
Joined: Wed Jul 16, 2008 12:59 pm
Location: Cochabamba-Bolivia

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

Postby karinha » Tue Nov 24, 2015 2:31 pm

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
 


João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7396
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

(SOLUCIONADO)

Postby RSalazarU » Tue Nov 24, 2015 5:39 pm

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
RSalazarU
 
Posts: 211
Joined: Wed Jul 16, 2008 12:59 pm
Location: Cochabamba-Bolivia

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

Postby Silvio.Falconi » Wed Nov 25, 2015 8:57 pm

How you user treport to create a factura ?
Can you post a small sample here ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6867
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 27 guests