FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour total in xbrowse
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
total in xbrowse
Posted: Tue Feb 26, 2013 07:57 PM

excuse me,
i'm starting to use xbrowse
I have customer.dbf
can someone help me put the total of INVOICE field to the bottom ?
thanks

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: total in xbrowse
Posted: Tue Feb 26, 2013 09:37 PM
I hope I can help you









@ 0, 0 XBROWSE oBrw OF oFld:adialogs[1] ;
PIXEL CELL LINES FOOTERS NOBORDER FASTEDIT


oBrw:=.t.
oBrw:nStretchCol:= -1
aBrowse := { { { ||IN->ITCODE}, i18n("Codice"), 50, },;
{ { ||IN->ITDESC }, i18n("Descrizione"), 180, } ,;
{ { ||IN->ITMEASURE }, i18n("U.m."), 40, } ,;
{ { ||IN->ITQTY }, i18n("Q.tà"), 30,"9999" } ,;
{ { ||IN->ITTAX }, i18n("Iva"), 40,"99%" } ,;
{ { ||IN->ITDESCONT}, i18n("Sconti"), 80, } ,;
{ { ||IN->ITUNIT }, i18n("Unitario"), 80,'@ €99,999.99' } ,;
{ { ||IN->ITTOTAL }, i18n("Totale"), 80,'@ €99,999.99' }}


FOR i := 1 TO Len(aBrowse)
oCol := oBrw:AddCol()
oCol:bEditValue := aBrowse[ i, 1 ]
oCol:cHeader := aBrowse[ i, 2 ]
oCol:nWidth := aBrowse[ i, 3 ]
if !Empty(aBrowse[ i, 4 ])
oCol:cEditPicture:=aBrowse[ i, 4 ]
Endif

oCol:oDataFont := oFont

oCol:bOnChange := { ||Calcolo_Riga(IN->ITQTY,IN->ITUNIT,IN->ITTAX,IN->ITDESCONT,OBRW),;
oBrw:MakeTotals(), ;
oBrw:RefreshFooters() }


NEXT


WITH OBJECT oBrw

....
WITH OBJECT oBrw:aCols[8]
:nDataStrAlign := AL_RIGHT
:cEditPicture := '@ €99,999.99'
:lTotal := .t.
* :nTotal := nTotal
:nFooterType := AGGR_SUM
:nFootStrAlign := AL_RIGHT
:nFootBmpNo := 1 // Footer BMP
END

:nStretchCol := STRETCHCOL_WIDEST
:=.f.
:=.T.
:lRecordSelector := .f.
:bChange = {|| oBrw:MakeTotals() }
END


oBrw:CreateFromCode()
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
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: total in xbrowse
Posted: Tue Feb 26, 2013 10:06 PM

Grazie silvio, domani provo e ti faccio sapere!

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: total in xbrowse
Posted: Wed Feb 27, 2013 08:09 AM

ok dimmi se hai problemi al massimo mi puoi chiamare in privato

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
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: total in xbrowse
Posted: Fri Mar 01, 2013 10:40 AM

ho creato la mia procedura, ma quando la dialog viene creata il totale non esce se poi clicco su una parte qualsiasi della dialog il totale esce:
questo è lo spezzone di prg:
*-------------------------------
@ 10,10 XBROWSE oBrw SIZE -10,-30 PIXEL OF oDlg ;
CELL LINES FOOTERS NOBORDER FASTEDIT

oBrw:lfooter:=.t.
oBrw:nStretchCol:= -1
aBrowse := { ;
{ { ||UTILE1->RAGSOC}, i18n("RAGIONE SOCIALE"), 360, },;
{ { ||UTILE1->KGTOTA }, i18n("KG TOTALI"), 80, '@E 9,999,999'} ,;
{ { ||UTILE1->IMPONI }, i18n("IMPONIBILE"), 80, '@E 999,999.99' } ,;
{ { ||UTILE1->EURTON }, i18n("UTILE/TN"), 60,'@E 99,999.99' } ,;
{ { ||UTILE1->BLOCCO }, i18n("BLK"), 30, }}

FOR i := 1 TO Len(aBrowse)
oCol := oBrw:AddCol()
oCol:bEditValue := aBrowse[ i, 1 ]
oCol:cHeader := aBrowse[ i, 2 ]
oCol:nWidth := aBrowse[ i, 3 ]
if !Empty(aBrowse[ i, 4 ])
oCol:cEditPicture:=aBrowse[ i, 4 ]
Endif
oCol:oDataFont := oFont

NEXT

WITH OBJECT oBrw

WITH OBJECT oBrw:aCols[2]
    :nDataStrAlign := AL_RIGHT
    :cEditPicture := '@E 99,999.99'
    :lTotal := .t.
    :nFooterType := AGGR_SUM
    :nFootStrAlign := AL_RIGHT
END

:nStretchCol := STRETCHCOL_WIDEST
:lHscroll:=.f.
:lVscroll:=.T.
:lRecordSelector := .f.
:bChange = {|| oBrw:MakeTotals() }

END

oBrw:CreateFromCode()

ACTIVATE DIALOG oDlg CENTERED
*------------------------------------------------------

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: total in xbrowse
Posted: Fri Mar 01, 2013 03:22 PM
damianodec wrote:excuse me,
i'm starting to use xbrowse
I have customer.dbf
can someone help me put the total of INVOICE field to the bottom ?
thanks

Which version of FWH are you using?
Regards



G. N. Rao.

Hyderabad, India
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: total in xbrowse
Posted: Fri Mar 01, 2013 04:31 PM

FWH 12.01 (jan 2012)

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: total in xbrowse
Posted: Fri Mar 01, 2013 06:38 PM

Please let us know the dbstructure() of the dbf you want to browse and which columns of the dbf you want to browse.

Regards



G. N. Rao.

Hyderabad, India
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: total in xbrowse
Posted: Fri Mar 01, 2013 07:01 PM

this is the dbstructure():
DbCreate( "c:\cruscotto\utile1", {{ "LOGICA","L", 1, 0 },;
{ "DOCENT" ,"C", 8, 0 },;
{ "CODICE" ,"C", 7, 0 },;
{ "RAGSOC" ,"C", 50, 0 },;
{ "SALDO" ,"N", 15,2 },;
{ "PAGATO" ,"N", 15,2 },;
{ "RISCHI" ,"N", 15,2 },;
{ "INSOLU" ,"L", 1,0 },;
{ "BLOCCO" ,"L", 1,0 },;
{ "LEGALE" ,"L", 1,0 },;
{ "KGTOTA" ,"N", 10,0 },;
{ "PERCUT" ,"N", 6,2 },;
{ "EURTON" ,"N", 10,2 },;
{ "IMPONI" ,"N", 12,2 },;
{ "TOTUTI" ,"N", 10,2 },;
{ "FIDO" ,"N", 10,2 } })

the columns are:
UTILE1->RAGSOC
UTILE1->KGTOTA
UTILE1->IMPONI
UTILE1->EURTON
UTILE1->PERCUT
UTILE1->TOTUTI
UTILE1->FIDO
(utile1->SALDO - UTILE1->PAGATO)
utile1->PAGATO
utile1->RISCHI
utile1->INSOLU
utile1->LEGALE
UTILE1->BLOCCO

thanks

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: total in xbrowse
Posted: Sun Mar 03, 2013 05:40 PM
hallo, I'm trying this code:
Code (fw): Select all Collapse
DEFINE FONT oFont   NAME "ARIAL" SIZE 0,-11 BOLD
   
   DEFINE DIALOG oDlg SIZE 760,440 FONT oFont ;
      TITLE 'Xbrowse Color Gradients'

   @ 10,10 XBROWSE oBrw  ;
            COLUMNS "codice", "ragsoc", "Saldo", "kgtota", "legale" ;
            OF oDlg ;
            SIZE 360,180 PIXEL ;
            FOOTERS LINES CELL 

   oBrw:bPopUp    := { |o| ColMenu( o ) }
   AEval( oBrw:aCols, { |o| o:cToolTip := { 'Column :' + CRLF + o:cHeader, 'ToolTip' } } )


   if !Empty( oCol := oBrw:oCol( "kgtota" ) )
      oCol:nTotal   := 0
      oCol:lTotal   := .t.
      oCol:nEditType := EDIT_GET
   endif

   oBrw:MakeTotals()
   oBrw:CreateFromCode()

    ACTIVATE DIALOG oDlg CENTERED


this is the same code of function RddBrwSelColsDlg in testxbr3.prg in samples FWH directory, but the total in KGTOTA is empty, why?
FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: total in xbrowse
Posted: Sun Mar 03, 2013 06:31 PM
Good way to start.

This is missing in your code:

In the line "@ 10,10 XBROWSE oBrw .............." you SHOULD add
the clause ALIAS "<aliasname>"


Instead of the older syntax
Code (fw): Select all Collapse
      oCol:nTotal   := 0
      oCol:lTotal   := .t.

you can use the new single line syntax:
Code (fw): Select all Collapse
oCol:nFooterType := AGGR_SUM
Regards



G. N. Rao.

Hyderabad, India
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: total in xbrowse
Posted: Mon Mar 04, 2013 08:35 AM
this is very hard for me... :-)
this is my new code:

Code (fw): Select all Collapse
#INCLUDE "FiveWin.ch"
#INCLUDE "xbrowse.ch"

FUNCTION xbrows()
Local oDbf

  local oDlg, oBrw, oCol, cAlias := cGetNewAlias( "UTILE1" )
  local oBr, oFont, cfunc

   cFunc := ProcName( 0 )

   USE UTILE1 NEW ALIAS (cAlias) SHARED VIA "DBFCDX"
   SET ORDER TO TAG FIRST
   GO TOP

   DEFINE FONT oFont   NAME "ARIAL" SIZE 0,-11 BOLD
   
   DEFINE DIALOG oDlg SIZE 760,440 FONT oFont ;
      TITLE 'Xbrowse Color Gradients'

   @ 10,10 XBROWSE oBrw  ;
            COLUMNS "codice", "ragsoc", "Saldo", "kgtota", "legale" ;
            HEADERS "a", "b", "c", "D", "e" ;
            OF oDlg ;
            SIZE 360,180 PIXEL ALIAS cAlias;
            AUTOSORT FOOTERS LINES CELL 
            
   if !Empty( oCol := oBrw:oCol( "kgtota" ) )
      oCol:nFooterType := AGGR_SUM
      oCol:nEditType := EDIT_GET
   endif

   oBrw:MakeTotals()
   oBrw:CreateFromCode()

    ACTIVATE DIALOG oDlg CENTERED

    RELEASE FONT oFont

return nil


but column kgtota is without total, please help me...
FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: total in xbrowse
Posted: Mon Mar 04, 2013 10:13 AM

if !Empty( oCol := oBrw:oCol( "kgtota" ) )

replace with if !Empty( oCol := oBrw:oCol( "D" ) ) // it is the header title that is assigned

Hth

Richard

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: total in xbrowse
Posted: Mon Mar 04, 2013 11:59 AM

thank Richard!!!

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: total in xbrowse
Posted: Tue Mar 05, 2013 02:56 PM

Again xbrowse,
I would like to put a value (total column 3 / total colum 5) to the bottom of column "kgtota" an not the total of "kgtota"
Thanks

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)