FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour TReport: como hacer que los TOTALES se impriman al final
Posts: 211
Joined: Wed Jul 16, 2008 12:59 PM

TReport: como hacer que los TOTALES se impriman al final

Posted: Tue Nov 24, 2015 02: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 (fw): Select all Collapse
---------------------------------------
|CANT  |DETALLE              |  VALOR |
---------------------------------------
|  10  |DETALLE              |    100 |
|  20  |DETALLE              |    200 |
---------------------------------------
|      TOTAL                 |    300 |
---------------------------------------

Como imprimo así
Code (fw): Select all Collapse
---------------------------------------
|CANT  |DETALLE              |  VALOR |
---------------------------------------
|  10  |DETALLE              |    100 |
|  20  |DETALLE              |    200 |
|      |                     |        |
|      |                     |        |
|      |                     |        |
|      |                     |        |
---------------------------------------
|      TOTAL                 |    300 |
---------------------------------------


De antemano, muchas gracias por la ayuda.

Rolando
Cochabamba, Bolivia
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM

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

Posted: Tue Nov 24, 2015 02:31 PM
Code (fw): Select all Collapse
#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
Posts: 211
Joined: Wed Jul 16, 2008 12:59 PM

(SOLUCIONADO)

Posted: Tue Nov 24, 2015 05:39 PM
Modifique la clase TReport()

Añadi la siguiente DATA
Code (fw): Select all Collapse
   DATA lColComplete INIT .F.


y en el metodo EndPage()
Code (fw): Select all Collapse
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.



Rolando
Cochabamba, Bolivia
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM

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

Posted: Wed Nov 25, 2015 08: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 March-April 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

Continue the discussion