Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #3196 > unrolled thread

Some filter advice required please

Started byMartin <spam@spam.spam>
First post2012-03-19 09:37 +0000
Last post2012-03-21 08:19 +0000
Articles 8 — 5 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Some filter advice required please Martin <spam@spam.spam> - 2012-03-19 09:37 +0000
    Re: Some filter advice required please Karl Faller <k.faller_withoutthat_@onlinehome.de> - 2012-03-19 10:52 +0100
      Re: Some filter advice required please Martin <spam@spam.spam> - 2012-03-19 12:44 +0000
    Re: Some filter advice required please Massimo Bighelli <info@arcasistemi.it> - 2012-03-19 12:27 +0100
      Re: Some filter advice required please Martin <spam@spam.spam> - 2012-03-19 12:44 +0000
    Re: Some filter advice required please D.J.W. van Kooten <public@ic2remove.this.com> - 2012-03-19 13:24 +0100
      Re: Some filter advice required please Martin <spam@spam.spam> - 2012-03-19 12:46 +0000
    Re: Some filter advice required please "Joachim Duerr (ADS)" <jojo.duerr@gmx.de> - 2012-03-21 08:19 +0000

#3196 — Some filter advice required please

FromMartin <spam@spam.spam>
Date2012-03-19 09:37 +0000
SubjectSome filter advice required please
Message-ID<H7D9r.8764$4p2.3273@newsfe29.ams2>
Hello

Got a bit of an issue and I am trying to find the best way round it.

I have a browser, skippered server running on a bbrowser.

Server is ADS.

A customer needs to find orders by invoice number, now that is normally 
not an issue - set a filter and they are restricted.

Now they do part orders and the invoice details are stored in another file.

So the filter has to return records where the invoice number matches or 
where a part of that order matches.

AFAIR functions in filters do not get ran as expected so are not much 
use. (found out ages ago).

File is open so could I run an SQL query on it?

Or do I use an array server?

Hmm - any suggestions appreciated.

Thanks

Martin

[toc] | [next] | [standalone]


#3197

FromKarl Faller <k.faller_withoutthat_@onlinehome.de>
Date2012-03-19 10:52 +0100
Message-ID<sd0em7h3q3bk0i4qtjp1st4d84ji7hjk2d@4ax.com>
In reply to#3196
On Mon, 19 Mar 2012 09:37:42 +0000, Martin <spam@spam.spam> wrote:

>So the filter has to return records where the invoice number matches or 
>where a part of that order matches.
probably i miss the obvious, but isn't that the classical
SetSelectiveRelation() cause??

Karl

[toc] | [prev] | [next] | [standalone]


#3203

FromMartin <spam@spam.spam>
Date2012-03-19 12:44 +0000
Message-ID<RSF9r.7560$jc6.1055@newsfe16.ams2>
In reply to#3197
But could be in main file or part file

On 19/03/2012 09:52, Karl Faller wrote:
> On Mon, 19 Mar 2012 09:37:42 +0000, Martin<spam@spam.spam>  wrote:
>
>> So the filter has to return records where the invoice number matches or
>> where a part of that order matches.
> probably i miss the obvious, but isn't that the classical
> SetSelectiveRelation() cause??
>
> Karl

[toc] | [prev] | [next] | [standalone]


#3198

FromMassimo Bighelli <info@arcasistemi.it>
Date2012-03-19 12:27 +0100
Message-ID<jk757p$tgo$1@speranza.aioe.org>
In reply to#3196
Martin

If I understand correctly, when I have to filter A depending on 
existance in B, I write a simple function (basically a B->seek and 
return .t./.f.) and pass this function to the filter codeblock (built 
with strings and macro) or to the filter string.
cbfilter := &("{||"+MySeekOnB()+"}")
don't have an example in hand now...
HTH
Massimo

Il 19/03/2012 10:37, Martin ha scritto:
> Hello
>
> Got a bit of an issue and I am trying to find the best way round it.
>
> I have a browser, skippered server running on a bbrowser.
>
> Server is ADS.
>
> A customer needs to find orders by invoice number, now that is normally
> not an issue - set a filter and they are restricted.
>
> Now they do part orders and the invoice details are stored in another file.
>
> So the filter has to return records where the invoice number matches or
> where a part of that order matches.
>
> AFAIR functions in filters do not get ran as expected so are not much
> use. (found out ages ago).
>
> File is open so could I run an SQL query on it?
>
> Or do I use an array server?
>
> Hmm - any suggestions appreciated.
>
> Thanks
>
> Martin

[toc] | [prev] | [next] | [standalone]


#3202

FromMartin <spam@spam.spam>
Date2012-03-19 12:44 +0000
Message-ID<ySF9r.7559$jc6.7091@newsfe16.ams2>
In reply to#3198
ADS tends to knacker this, tried when we first went to VO

But works with DBFCDX



On 19/03/2012 11:27, Massimo Bighelli wrote:
> Martin
>
> If I understand correctly, when I have to filter A depending on
> existance in B, I write a simple function (basically a B->seek and
> return .t./.f.) and pass this function to the filter codeblock (built
> with strings and macro) or to the filter string.
> cbfilter := &("{||"+MySeekOnB()+"}")
> don't have an example in hand now...
> HTH
> Massimo
>
> Il 19/03/2012 10:37, Martin ha scritto:
>> Hello
>>
>> Got a bit of an issue and I am trying to find the best way round it.
>>
>> I have a browser, skippered server running on a bbrowser.
>>
>> Server is ADS.
>>
>> A customer needs to find orders by invoice number, now that is normally
>> not an issue - set a filter and they are restricted.
>>
>> Now they do part orders and the invoice details are stored in another
>> file.
>>
>> So the filter has to return records where the invoice number matches or
>> where a part of that order matches.
>>
>> AFAIR functions in filters do not get ran as expected so are not much
>> use. (found out ages ago).
>>
>> File is open so could I run an SQL query on it?
>>
>> Or do I use an array server?
>>
>> Hmm - any suggestions appreciated.
>>
>> Thanks
>>
>> Martin
>

[toc] | [prev] | [next] | [standalone]


#3199

FromD.J.W. van Kooten <public@ic2remove.this.com>
Date2012-03-19 13:24 +0100
Message-ID<059em7ddaltt168rvaa9a391f6l1u9mh89@4ax.com>
In reply to#3196
On Mon, 19 Mar 2012 09:37:42 +0000, Martin <spam@spam.spam> wrote:

Hello Martin,

>So the filter has to return records where the invoice number matches or 
>where a part of that order matches.

If I understand you right: 

Basically you have a random range of invoicenumbers (found in another
database). If it's a subsequent range in the other database, an
orderscope on the invoice database would do. Otherwise, collect the
invoice records matching the invoice numbers in an array first and
pass that to the method below. Even with many 1000's of invoices it
will prove to be fast.

Dick

METHOD SetRecordFilter(aRecs AS ARRAY) AS DWORD PASCAL CLASS
FactuurVenster
//#s Filters database to aRecords content 

LOCAL oServer AS OBJECT
LOCAL oFilterBlock AS FilterBlock
LOCAL nAantal AS DWORD
LOCAL ni,nRec AS DWORD
LOCAL tbhandle AS DWORD


	oServer:=SELF:Server
	nAantal:=ALen(aRecs) // Number of records passed
	IF ReturnVar("LUSEADS") // ADS: different record filtering
8-9-2010
		IF nAantal>0 // >1?
			tbhandle:=oServer:INFO(
DBI_GET_ACE_TABLE_HANDLE ) // Get handle of current db
 AdsSetAOF(DWORD(_CAST,tbhandle),String2Psz(".F."),
ADS_RESOLVE_DYNAMIC)		// Init: no records  selected
			FOR ni:=1 UPTO nAantal // Add all records
				nRec:=aRecs[ni]
				AdsCustomizeAOF(tbhandle, 1, @nRec,
ADS_AOF_ADD_RECORD)						//
Adds to ADS filter					
			NEXT
		ENDIF
	ELSE	
		oFilterBlock := FilterBlock{oServer,
{|oSrv|oSrv:IsSelected()}}
		oServer:aRecords := aRecs
	ENDIF

	IF nAantal=0
		Warningbox{SELF,Vt(PSB_SELECTRANGE,"Bereik
geselecteerd"),Vt(PSB_VOLLEDIG,"Aantal records is 0 - terug naar
volledige selectie")}:Show()
		SELF:ClearRecordFilter()
	ELSE
		IF !ReturnVar("LUSEADS")		
			oServer:SetFilter(oFilterBlock)
		ENDIF
		SELF:Server:GoTop() // GoTop
		SELF:lRecordFilter:=TRUE
		SELF:nNowInFilter:=nAantal
*		SELF:DisplayName(FALSE)
	ENDIF	
RETURN nAantal

[toc] | [prev] | [next] | [standalone]


#3204

FromMartin <spam@spam.spam>
Date2012-03-19 12:46 +0000
Message-ID<1VF9r.7561$jc6.2406@newsfe16.ams2>
In reply to#3199
Actually could be in either file, but I have trialed some techniques and 
a class which uses record numbers in its skipper seems to be fine.

WIll be testing soon and may be the technique we need

Thanks

Martin

On 19/03/2012 12:24, D.J.W. van Kooten wrote:
> On Mon, 19 Mar 2012 09:37:42 +0000, Martin<spam@spam.spam>  wrote:
>
> Hello Martin,
>
>> So the filter has to return records where the invoice number matches or
>> where a part of that order matches.
>
> If I understand you right:
>
> Basically you have a random range of invoicenumbers (found in another
> database). If it's a subsequent range in the other database, an
> orderscope on the invoice database would do. Otherwise, collect the
> invoice records matching the invoice numbers in an array first and
> pass that to the method below. Even with many 1000's of invoices it
> will prove to be fast.
>
> Dick
>
> METHOD SetRecordFilter(aRecs AS ARRAY) AS DWORD PASCAL CLASS
> FactuurVenster
> //#s Filters database to aRecords content
>
> LOCAL oServer AS OBJECT
> LOCAL oFilterBlock AS FilterBlock
> LOCAL nAantal AS DWORD
> LOCAL ni,nRec AS DWORD
> LOCAL tbhandle AS DWORD
>
>
> 	oServer:=SELF:Server
> 	nAantal:=ALen(aRecs) // Number of records passed
> 	IF ReturnVar("LUSEADS") // ADS: different record filtering
> 8-9-2010
> 		IF nAantal>0 //>1?
> 			tbhandle:=oServer:INFO(
> DBI_GET_ACE_TABLE_HANDLE ) // Get handle of current db
>   AdsSetAOF(DWORD(_CAST,tbhandle),String2Psz(".F."),
> ADS_RESOLVE_DYNAMIC)		// Init: no records  selected
> 			FOR ni:=1 UPTO nAantal // Add all records
> 				nRec:=aRecs[ni]
> 				AdsCustomizeAOF(tbhandle, 1, @nRec,
> ADS_AOF_ADD_RECORD)						//
> Adds to ADS filter					
> 			NEXT
> 		ENDIF
> 	ELSE	
> 		oFilterBlock := FilterBlock{oServer,
> {|oSrv|oSrv:IsSelected()}}
> 		oServer:aRecords := aRecs
> 	ENDIF
>
> 	IF nAantal=0
> 		Warningbox{SELF,Vt(PSB_SELECTRANGE,"Bereik
> geselecteerd"),Vt(PSB_VOLLEDIG,"Aantal records is 0 - terug naar
> volledige selectie")}:Show()
> 		SELF:ClearRecordFilter()
> 	ELSE
> 		IF !ReturnVar("LUSEADS")		
> 			oServer:SetFilter(oFilterBlock)
> 		ENDIF
> 		SELF:Server:GoTop() // GoTop
> 		SELF:lRecordFilter:=TRUE
> 		SELF:nNowInFilter:=nAantal
> *		SELF:DisplayName(FALSE)
> 	ENDIF	
> RETURN nAantal

[toc] | [prev] | [next] | [standalone]


#3230

From"Joachim Duerr (ADS)" <jojo.duerr@gmx.de>
Date2012-03-21 08:19 +0000
Message-ID<9sth83F6s3U1@mid.individual.net>
In reply to#3196
Martin wrote:

>
>File is open so could I run an SQL query on it?

yes. I'd use SQL and the AdsSQLServer class.

-- 
Joachim Duerr, Advantage Presales
*** NEW *** Advantage Pocket Guide released  *** NEW ***
http://pocketguide.jd-engineering.de

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web