total in xbrowse

total in xbrowse

Postby damianodec » Tue Feb 26, 2013 7: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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: total in xbrowse

Postby Silvio.Falconi » Tue Feb 26, 2013 9:37 pm

I hope I can help you

Image







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


oBrw:lfooter:=.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
:lHscroll:=.f.
:lVscroll:=.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 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: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: total in xbrowse

Postby damianodec » Tue Feb 26, 2013 10:06 pm

Grazie silvio, domani provo e ti faccio sapere!
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: total in xbrowse

Postby Silvio.Falconi » Wed Feb 27, 2013 8: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 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: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: total in xbrowse

Postby damianodec » 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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: total in xbrowse

Postby nageswaragunupudi » Fri Mar 01, 2013 3: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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: total in xbrowse

Postby damianodec » Fri Mar 01, 2013 4:31 pm

FWH 12.01 (jan 2012)
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: total in xbrowse

Postby nageswaragunupudi » Fri Mar 01, 2013 6: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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: total in xbrowse

Postby damianodec » Fri Mar 01, 2013 7: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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: total in xbrowse

Postby damianodec » Sun Mar 03, 2013 5:40 pm

hallo, I'm trying this code:
Code: Select all  Expand view

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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: total in xbrowse

Postby nageswaragunupudi » Sun Mar 03, 2013 6: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: Select all  Expand view
     oCol:nTotal   := 0
      oCol:lTotal   := .t.
 

you can use the new single line syntax:
Code: Select all  Expand view
oCol:nFooterType := AGGR_SUM
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: total in xbrowse

Postby damianodec » Mon Mar 04, 2013 8:35 am

this is very hard for me... :(
this is my new code:

Code: Select all  Expand view

#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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: total in xbrowse

Postby Richard Chidiak » 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
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: total in xbrowse

Postby damianodec » Mon Mar 04, 2013 11:59 am

thank Richard!!!
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: total in xbrowse

Postby damianodec » Tue Mar 05, 2013 2: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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 112 guests

cron