total in xbrowse

Re: total in xbrowse

Postby nageswaragunupudi » Tue Mar 05, 2013 3: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: Select all  Expand view  RUN

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
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: total in xbrowse

Postby damianodec » Tue Mar 05, 2013 7:05 pm

Thank you, tomorrow I'll try that code.
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 » Wed Mar 06, 2013 7:14 pm

ok nageswaragunupudi, it's ok.
I have a question:
if I use ths code:
Code: Select all  Expand view  RUN

@ 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 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 » Wed Mar 06, 2013 7: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: Select all  Expand view  RUN
@ 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
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: total in xbrowse

Postby damianodec » Wed Mar 06, 2013 8:20 pm

Good very good, i'll try.
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 » Wed Mar 06, 2013 8: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 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 » Wed Mar 06, 2013 8:42 pm

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

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

Re: total in xbrowse

Postby damianodec » Wed Mar 06, 2013 9:34 pm

Explain me, if I want to use combining two .dbf in xbrowse, how can I do?
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 » Wed Mar 06, 2013 9: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
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: total in xbrowse

Postby damianodec » Wed Mar 06, 2013 10:04 pm

Ok, if field states->nane is numeric, can I to get total on foot?
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 » Wed Mar 06, 2013 10:05 pm

yes
Regards

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

Re: total in xbrowse

Postby damianodec » Wed Mar 06, 2013 10:40 pm

Thank you!!!
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

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 58 guests