filter on tdabase

filter on tdabase

Postby Silvio.Falconi » Wed Jan 23, 2019 10:41 am

I have a dbf open with tdatabase a with filter and I wish add another filter
But the function FiltraBase make error because probable not run the setfilter command


and I made

I open two area of Tariffe.dbf

1. oTariffeOneDay
2. oTariffeMulti

have the filter

cFilter1 := 'FIELD->GIORNI=1' //oneday
cFilter2 := 'FIELD->GIORNI>1' //from 2 to x

oTariffeOneDay:= TTariffe():new()
oTariffeOneDay:setFilter( cFilter1)
oTariffeOneDay:gotop()

oTariffeMultipli:= TTariffe():new()
oTariffeMultipli:setFilter(cFilter2)
oTariffeMultipli:gotop()

Now I wish change the filter selecting the combobox

on the combobox I insert


@ 36,75 COMBOBOX cFilter ITEMS ArrTranspose( aListini )[ 1] ;
SIZE 100,400 PIXEL OF oDlgTariffe;
ON CHANGE FiltraBase(oBrw1,cfilter,aListini,cFilter1,oTariffeOneDay)


Function FiltraBase(oBrw1,cfilter,aListini,oTariffeOneDay)
// make a filter on otariffeoneday
oTariffeOneDay:setfilter(trim(oTariffeOneDay:idlistino)==Search_cod(cFilter,alistini) .AND. oTariffeOneDay:GIORNI=1 )
oTariffeOneDay:gotop()
oBrw1:refresh()
return nil
//-------------------------------------------------------------------------------------------------------------------------------------------------//
Function Search_cod(cFilter,alistini)
Local nAt := AScan( alistini, { |a| a[ 1 ] == cFilter } )
Local cCode:="01" //primo record
If nAt>0
cCode:= alistini[nAt][2]
endif
return cCode
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: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: filter on tdabase

Postby James Bott » Wed Jan 23, 2019 5:16 pm

Try:

cX := Search_cod(cFilter,aListini)

oTariffeOneDay:setFilter( "IDListNo == " + cX + " .and. giorni=1" )
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: filter on tdabase

Postby Silvio.Falconi » Wed Jan 23, 2019 8:26 pm

Application
===========
Path and name: C:\Work\Errori\tariffe_james\tariffe.Exe (32 bits)
Size: 4,210,176 bytes
Compiler version: Harbour 3.2.0dev (r1703231115)
FiveWin version: FWH 18.12
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 7 secs
Error occurred at: 23-01-2019, 21:26:14
Error description: Error BASE/1004 No exported method: SETFILTER
Args:
[ 1] = C FIELD->GIORNI=1
[ 2] = C IDListiNo == 02 .and. giorni=1
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: 7076
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests