FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour total in xbrowse
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: total in xbrowse
Posted: Tue Mar 05, 2013 03:57 PM
damianodec wrote: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


Code (fw): Select all Collapse
oBrw:oCol( 3 ):nFooterType := AGGR_TOTAL
oBrw:oCol( 5 ):nFooterType := AGGR_TOTAL
oBrw:oCol( 4 ):bFooter  := { || oBrw:oCol( 3 ):nTotal / oBrw:oCol( 5 ):nTotal }
Regards



G. N. Rao.

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

Thank you, tomorrow I'll try that code.

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: Wed Mar 06, 2013 07:14 PM
ok nageswaragunupudi, it's ok.
I have a question:
if I use ths code:
Code (fw): Select all Collapse
@ 10,10 XBROWSE oBrw SIZE -10,-30 PIXEL OF oDlg ;
            FOOTERS LINES CELL ;

ADD COLUMN TO oBrw;
    DATA utile2->descri;
    HEADER "DESCRIZIONE" ;
    SIZE 280

ADD COLUMN TO oBrw;
    DATA utile2->UM;
    HEADER "UM"
    
ADD COLUMN TO oBrw;
    DATA utile2->quanti;
    HEADER "QUANTITA'";
    PICTURE "@E 9,999,999.99" ;
    SIZE 70 TOTAL ntotal FOOTER ufoot

oBrw:MakeTotals()
oBrw:CreateFromCode()

I get this error:
Time from start: 0 hours 0 mins 15 secs
Error occurred at: 06-03-2013, 18:50:14
Error description: Error BASE/1004 Class: 'NIL' has no exported method: EVAL
Args:
[ 1] = U
[ 2] = U

Stack Calls
===========
Called from: => EVAL( 0 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:BOOKMARK( 2847 )
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:MAKETOTALS( 6593 )

can you 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: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: total in xbrowse
Posted: Wed Mar 06, 2013 07:43 PM
You have to specify the DATASOURCE in the XBROWSE command.
You did not specify the alias "utile2" as datasource in the command. That is the problem

Code (fw): Select all Collapse
@ 10,10 XBROWSE oBrw SIZE -10,-30 PIXEL OF oDlg ;
            DATASOURCE "utile2" FOOTERS LINES CELL ;


Explanation:
When the line oBrw:MakeTotals() is executed, XBrowse should know from where to read the data and total. When you did not inform xbrowse the datasource, it fails.

CAUTION:
Please NEVER forget to specify the datasource while creating xbrowse. The datasouce can be an array, alias, object, etc.


Note:
Though you can create columns by using ADD command, I strongly recommend creating the columns with COLUMNS command inside the main XBROWSE command.
That has many advantages you will realise as you go.
Regards



G. N. Rao.

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

Good very good, i'll try.

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: Wed Mar 06, 2013 08:25 PM

Yes, but I want restrict utile2.dbf using ordscope() function. which command can I use with cAlias in xbrowse, LOCATE, SET FILTER?

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: Wed Mar 06, 2013 08:42 PM

You can use ordscope() or setfilter() as you like. Before or during xbrowse.

Regards



G. N. Rao.

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

Explain me, if I want to use combining two .dbf in xbrowse, how can I do?

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: Wed Mar 06, 2013 09:46 PM
damianodec wrote:Explain me, if I want to use combining two .dbf in xbrowse, how can I do?

You probably mean when a dbf is set relation to another.
Assume that the customer.dbf is related to states.dbf in the fwh\samples folder/

@ 0,0 XBROWSE oBrw OF oWnd DATASOURCE "CUSTOMER" ;
COLUMNS "First", "City", "State", "STATES->Name" ;
HEADERS nil, nil, nil, "StateName" .......... <remaining clauses>
Regards



G. N. Rao.

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

Ok, if field states->nane is numeric, can I to get total on foot?

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: Wed Mar 06, 2013 10:05 PM

yes

Regards



G. N. Rao.

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

Thank you!!!

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)

Continue the discussion