none
How To Add Filter Option In Grid RRS feed

  • Question

  • Dear all

    i need to add filter option  in SORTNO AND SHADE NAME FILED IN  grid program for following screen-shot

    where i can add filter option in my program please help me 

    the program is below.

    ****************************

    CLOSE ALL
    _Screen.Themes = .F.  
    ff22="zda11"+RIGHT(SYS(3),3) &&+STRTRAN(SUBSTR(pkv_ip,7,13), ".","")+".dbf"
    ff33="zda22"+RIGHT(SYS(3),3) &&+STRTRAN(SUBSTR(pkv_ip,7,13), ".","")+".dbf"
    ff44="zda33"+RIGHT(SYS(3),3) &&+STRTRAN(SUBSTR(pkv_ip,7,13), ".","")+".dbf"
    ff55="zda44"+RIGHT(SYS(3),3) &&+STRTRAN(SUBSTR(pkv_ip,7,13), ".","")+".dbf"
    ff66="zda55"+RIGHT(SYS(3),3) &&+STRTRAN(SUBSTR(pkv_ip,7,13), ".","")+".dbf"
    ff77="zda77"+RIGHT(SYS(3),3) &&+STRTRAN(SUBSTR(pkv_ip,7,13), ".","")+".dbf"


    CREATE TABLE &ff77 (code c(6),shade n(6),sortno c(15),ictr n(3),sctr n(3), shadename c(20), dsg c(30))
    USE &ff77 EXCLUSIVE
    INDEX on code TAG itm
    INDEX on STR(shade,6) TAG shd

    ************************************************************************
    isediting=.t.
    define window ap01 ;
    at  0.000, 0.000  ;
    size 42.229,140.000 ;
    title chold ;
    font "MS Sans Serif", 8 ;
    style "B" ;
    float ;
    noclose ;
    minimize ;
    fill file "miss1.sys";
    color rgb(,,,192,192,192)
    move window ap01 center
    ACTIVATE WINDOW ap01
    ************************************************************************
    @ 0.538,4.500 SAY "Despatch Advice" ;
    FONT "MS Sans Serif", 14 ;
    STYLE "BT" ;
    COLOR RGB(192,192,192,192,192,192)
    @ 0.385,4.000 SAY "Despatch Advice" ;
    FONT "MS Sans Serif", 14 ;
    STYLE "BT"
    @ 3.077,0.000 TO 3.077,139.333 ;
    PEN 1, 8 ;
    STYLE "2"

    STORE "Domestic" TO motyp
    STORE "" TO mordtype,slcd
    STORE "522110" TO glcd
    STORE 0 TO mordno,lno,spcs,sqty, mdano,soctr
    STORE 0 TO bc,bg,bq,bgq
    DIMENSION grd(6)
    grd(1)="A"
    grd(2)="B"
    grd(3)="C"
    grd(4)="D"
    grd(5)="Z"
    grd(6)="E"

    STORE 0 TO msc
    STORE 1 TO msct

    SAVE SCREEN TO pp

    @ 6.538,4.500 SAY "Selection Criteria" ;
    FONT "MS Sans Serif", 14 ;
    STYLE "BT" ;
    COLOR RGB(192,192,192,192,192,192)
    @ 6.385,4.000 SAY "Selection Criteria" ;
    FONT "MS Sans Serif", 14 ;
    STYLE "BT"
    @ 8.277,4.000 TO 8.277,30.333 ;
    PEN 2, 8 ;
    STYLE "2"


    @  12.000,4.000 say "SELECTION" size 1.000,12.000  font "MS Sans Serif", 10 picture "@KI" color w/rb+
    @ 12.000,27.000 GET msct;
    PICTURE "@^ Select All Cartons,De-select All Cartons";
    SIZE 3.538,30.000 ;
    DEFAULT msct ;
    FONT "MS Sans Serif", 8
    @  14.000,4.000 say "CARTONS" size 1.000,12.000  font "MS Sans Serif", 10 picture "@KI" color w/rb+

    @ 14.000,27.167 get msc size 1.000,11.900 default 0 font "MS Sans Serif", 8 ;
    picture "@J 999999" when isediting color r/b+
    read

    RESTORE SCREEN FROM pp

    IF msct=1
    mflg=.t.
    ELSE
    mflg=.f.
    ENDIF
    IF msc>0
    mflg=.f.
    ENDIF 

    @  4.000,1.000 say "SO #" size 1.000,12.000  font "MS Sans Serif", 10 picture "@KI" color w/rb+

    @  6.000,4.000 say "CODE" size 1.000,6.000  font "MS Sans Serif", 10 picture "@KI" color w/rb+
    @  6.000,16.000 say "PRODUCT" size 1.000,10.000  font "MS Sans Serif", 10 picture "@KI" color w/rb+
    @  6.000,53.000 say "PCS" size 1.000,6.000  font "MS Sans Serif", 10 picture "@KI" color w/rb+
    @  6.000,67.000 say "QUANTITY" size 1.000,10.000  font "MS Sans Serif", 10 picture "@KI" color w/rb+

    @  5.000,93.000 say "   DA SELECTION   " size 1.000,20.000  font "Calibri", 10 picture "@KI" color w/rb+
    @  6.000,90.000 say "PCS" size 1.000,8.000  font "Calibri", 10 picture "@KI" color w/rb+
    @  6.000,107.000 say "QUANTITY" size 1.000,10.000  font "Calibri", 10 picture "@KI" color w/rb+

    @ 4.000,17.000 GET motyp;
    PICTURE "@^ Domestic,Export,Jobwork";
    SIZE 3.538,15.000 ;
    DEFAULT " " ;
    valid chkord();
    FONT "MS Sans Serif", 8 

    stor 1 to mor
    do whil mor=1

    stor 2 to ok
    do whil ok=2

    @ 4.000,33.167 get mordno size 1.000,11.900 default DATE() font "MS Sans Serif", 8 ;
    picture "@J 999999" valid chkord() when isediting color r/b+
    read

    IF mordno=0
    DEACTIVATE WINDOW ap01
    RELEASE WINDOWS ap01
    CLOSE ALL
    RETURN
    ENDIF 
    DIMENSION cn1(1)
    STORE 0 TO cn1
    SELECT NVL(COUNT(*),0) INTO ARRAY cn1 FROM crtnmst WHERE unit=unt AND ordertype=mordtype AND orderno=mordno AND isitsale#"Y" AND whflag="R"
    IF cn1=0
    DO alrt with "This order having no Stock In Ware-House!"
    LOOP 
    ENDIF 

    SELECT crtnno,crtntype,c.name grade,item,crtnpcs,crtnqty,crtngwt,b.name,a.ordertype,a.orderno, ;
    SPACE(30) dsgname,SPACE(15) sortno,SPACE(15) shadename ;
    INTO CURSOR cdtl ;
    FROM crtnmst a, itmstr b, grades c ;
    WHERE a.unit=unt AND b.unit=unt AND b.code=a.item AND a.grade=1 ;
    AND c.code=a.grade ;
    AND a.ordertype=mordtype AND a.orderno=mordno AND isitsale#"Y" AND whflag="R" ORDER BY sortno,crtnno
    SUM crtnpcs TO bg
    SUM crtnqty TO bq
    COPY to &ff44


    * Check Product
    SELECT c
    USE shdmst ORDER cod SHARED 
    SELECT d
    USE crtndtl orde cod SHARED 
    SELECT e
    USE &ff77 ORDER itm  EXCLUSIVE 
    SELECT f
    USE &ff44
    GO top
    DO whil NOT EOF()
    SELECT d
    SEEK unt+STR(f->crtnno,10)
    DO whil unit=unt AND crtnno=f->crtnno AND NOT EOF()
    SELECT e
    SET ORDER TO itm
    SEEK d->item
    IF NOT FOUND()
    APPEND BLANK
    REPLACE code WITH d->item
    REPLACE sortno WITH d->sortno
    ENDIF 

    SELECT d
    SKIP
    endd
    SELECT e
    SET ORDER TO itm
    COUNT TO ctr1
    GO top
    IF ctr1>1
    SELECT f
    REPLACE name WITH "ASSORTED"
    ELSE
    SELECT f
    REPLACE sortno WITH e->sortno
    ENDIF 
    * Check Shade
    SELECT e
    zap
    SET ORDER TO shd
    SELECT d
    SEEK unt+STR(f->crtnno,10)
    DO whil unit=unt AND crtnno=f->crtnno AND NOT EOF()
    SELECT e
    SEEK STR(d->shadecode,6)
    IF NOT FOUND()
    APPEND BLANK
    REPLACE shade WITH d->shadecode
    SELECT c
    SEEK STR(d->shadecode,6)
    SELECT e
    REPLACE shadename WITH c->name
    ENDIF

    SELECT d
    SKIP
    endd
    SELECT e
    SET ORDER TO shd
    COUNT TO ctr2
    GO top
    IF ctr2>1
    SELECT f
    REPLACE shadename WITH "ASSORTED"
    ELSE 
    SELECT f
    REPLACE shadename WITH e->shadename
    ENDIF 
    SELECT e
    ZAP 
    SELECT f
    SKIP 
    endd

    SELECT c
    USE
    USE specsent ORDER cod
    SELECT f
    GO top
    DO whil NOT EOF()
    IF sortno#" "
    SELECT c
    SEEK f->sortno+mordtype+STR(mordno,6)+f->item
    IF FOUND()
    SELECT f
    REPLACE dsgname WITH c->dsgname
    ENDIF 
    ENDIF 
    SELECT f
    SKIP 
    endd

    SELECT c
    USE
    SELECT d
    USE
    SELECT e
    USE
    SELECT f
    USE

    do alrt with  "You have "+ltrim(str(bg,6))+" PCS and "+str(bq,12,3)+" Kgs Quantity. . ."
    IF bg=0 OR bq=0
    DEACTIVATE WINDOW ap01
    RELEASE WINDOWS ap01
    CLOSE ALL
    RETURN
    ENDIF 
    DO selcrtn

    @ 1,85.000 get spcs size 1.000,1.000  font "Calibri", 10 ;
    picture "@K 9"  color w/rb+ styl "B"
    READ


    SELECT a.item,a.shadecode,b.otype,b.ordno,SUM(a.Crtnpcs) pcs,SUM(a.crtnqty) qty, ;
    0 tcrtn, 0 gqty ;
    INTO CURSOR id1 ;
    FROM crtndtl a, &ff33 b ;
    WHERE a.unit=unt AND a.crtnno=b.crtnno GROUP BY a.item,a.shadecode,b.otype,b.ordno
    COPY TO &ff66
    USE

    SELECT a.item,b.otype,b.ordno,SUM(a.Crtnpcs) pcs,SUM(a.crtnqty) qty, ;
    0 tcrtn, 0 gqty ;
    INTO CURSOR id1 ;
    FROM crtndtl a, &ff33 b ;
    WHERE a.unit=unt AND a.crtnno=b.crtnno GROUP BY a.item,b.otype,b.ordno
    COPY TO &ff55
    USE


    CLOSE DATABASES
    SELECT a
    USE &ff55
    SELECT b
    USE &ff22 EXCLUSIVe
    USE
    ALTER table &ff22;
    ADD spcs n(10);
    ADD sqty n(14,3)

    USE &ff22 EXCLUSIVE
    INDEX on STR(ordno,6)+item TAG cod
    SET ORDER TO cod
    SELECT a
    GO top
    DO whil NOT EOF()
    SELECT b
    SEEK STR(mordno,6)+a->item
    IF FOUND()
    REPLACE spcs WITH spcs+a->pcs
    REPLACE sqty WITH sqty+a->qty
    ELSE
    APPEND BLANK
    REPLACE item WITH a->item
    REPLACE spcs WITH spcs+a->pcs
    REPLACE sqty WITH sqty+a->qty
    ENDIF 
    SELECT a
    SKIP
    endd 
    SELECT b
    GO top
    @ 7.400,2 clea to 22,130
    lno=6
    DO whil NOT EOF()
    lno=lno+1.5
    @ lno,3.000 get item size 1.000,10.000  font "Calibri", 10 ;
    picture "@K!"  color w/rb+ styl "B"
    @ lno,16.000 get name size 1.000,30.000  font "Calibri", 10 ;
    picture "@K!"  color w/rb+ styl "B"
    @ lno,52.000 get bpcs size 1.000,10.000  font "Calibri", 10 ;
    picture "@K 99999999"  color w/rb+ styl "B"
    @ lno,65.000 get bqty size 1.000,15.000  font "Calibri", 10 ;
    picture "@K 99999999.999"  color w/rb+ styl "B"
    @ lno,87.000 get spcs size 1.000,10.000  font "Calibri", 10 ;
    picture "@K 99999999"  color w/rb+ styl "B"
    @ lno,105.000 get sqty size 1.000,15.000  font "Calibri", 10 ;
    picture "@K 99999999.999"  color w/rb+ styl "B"
    skip
    endd 
    CLEAR gets
    @ 30.077,16.800 GET ok ;
    PICTURE "@*HT \<Process;\<Cancel" ;
    SIZE 1.769,12.667,2.667 ;
    DEFAULT 1 ;
    FONT "MS Sans Serif", 8 ;
    STYLE "B"
    read
    @ 30,16 clea to 32,70
    endd
    IF ok=1
    soctr=soctr+1
    CLOSE DATABASES
    SELECT a
    USE damst ORDER cod
    SELECT b
    USE damstso ORDER cod
    SELECT c
    USE &ff22
    SELECT e
    USE &ff66
    SELECT f
    USE &ff33

    IF soctr=1
    SELECT f
    USE
    USE control ORDER ctr
    SEEK unt+"DA01"
    IF NOT FOUND()
    DO alrt WITH "DA master failed!"
    DEACTIVATE WINDOW all
    RELEASE WINDOWS all
    CLOSE ALL
    RETURN 
    ENDIF 
    DO whil .t.
    IF FLOCK()
    STORE lastno TO mdano
    mdano=mdano+1
    REPLACE lastno WITH mdano
    UNLOCK
    EXIT 
    ENDIF 
    endd 
    SELECT f
    use
    USE &ff33
    SELECT a

    *SEEK unt
    *DO whil unit=unt AND NOT EOF()
    * STORE danumber TO mdano
    * SKIP 
    *endd
    *mdano=mdano+1
    APPEND BLANK
    REPLACE unit WITH unt
    REPLACE danumber WITH mdano
    REPLACE dadate WITH DATE()
    REPLACE code_s WITH slcd
    REPLACE totalcrtn WITH bc
    REPLACE totalpcs WITH bg
    REPLACE totalnwt WITH bq
    REPLACE totalgwt WITH bgq
    REPLACE addby WITH id
    REPLACE addat WITH DATETIME()
    REPLACE addip WITH pkv_ip
    ELSE
    SELECT a
    SEEK unt+STR(mdano,10)
    IF FOUND()
    REPLACE totalcrtn WITH totalcrtn+bc
    REPLACE totalpcs WITH totalpcs+bg
    REPLACE totalnwt WITH totalnwt+bq
    REPLACE totalgwt WITH totalgwt+bgq
    ENDIF 
    ENDIF 
    SELECT c
    GO top
    DO whil NOT EOF()
    SELECT b
    APPEND BLANK
    REPLACE unit WITH unt
    REPLACE danumber WITH mdano
    REPLACE datype WITH "S"
    REPLACE sotype WITH mordtype
    REPLACE sonumber WITH mordno
    REPLACE item WITH c->item
    REPLACE ordpcs WITH c->bpcs
    REPLACE ordqty WITH c->bqty
    REPLACE dapcs WITH c->spcs
    REPLACE daqty WITH c->sqty
    SELECT c
    SKIP
    endd
    SELECT e
    GO top
    DO whil NOT EOF()
    SELECT b
    APPEND BLANK
    REPLACE unit WITH unt
    REPLACE danumber WITH mdano
    REPLACE datype WITH "D"
    REPLACE sotype WITH mordtype
    REPLACE sonumber WITH mordno
    REPLACE item WITH e->item
    REPLACE shadeno WITH e->shadecode
    REPLACE dapcs WITH e->pcs
    REPLACE daqty WITH e->qty
    SELECT e
    SKIP
    endd
    SELECT d
    USE crtnmst ORDER cod
    SELECT f
    GO top
    DO whil NOT EOF()
    SELECT d
    SEEK unt+STR(f->crtnno,10)
    IF FOUND()
    REPLACE isitsale WITH "Y"
    REPLACE invtype WITH "DA"
    REPLACE invno WITH mdano
    ENDIF 
    SELECT f
    SKIP 
    endd
    CLOSE ALL
    ENDIF 
    @ 30.077,16.800 GET mor;
    PICTURE "@*HT \<More SO;\<Release;\<Cancel" ;
    SIZE 1.769,12.667,2.667 ;
    DEFAULT 1 ;
    FONT "MS Sans Serif", 8 ;
    STYLE "B"
    read
    @ 30,16 clea to 32,70
    endd
    IF mor=2
    DO alrt WITH "DA #"+LTRIM(STR(mdano,10))+" Generated!"
    ENDIF 
    IF mor=3
    CLOSE ALL
    DELETE FROM damst WHERE unit=unt AND danumber=mdano
    DELETE FROM damstso WHERE unit=unt AND danumber=mdano
    USE crtnmst
    REPLACE ALL isitsale WITH "",invtype WITH "",invno WITH 0 FOR unit=unt and invtype="DA" AND invno=mdano
    ENDIF 

    *SET DEFAULT TO d:\works\finance


    DEACTIVATE WINDOW ap01
    RELEASE WINDOWS ap01
    CLOSE ALL
    RETURN
    ******************************************
    PROCEDURE chkord
    IF mordno=0
    RETURN .t.
    ENDIF 
    DIMENSION cn1(1),cl(1)
    STORE 0 TO cl
    cn1=""
    STORE "I308" TO mordtype

    IF motyp="D"
    STORE "I301" TO mordtype
    ENDIF 
    IF motyp="E"
    STORE "I306" TO mordtype
    ENDIF 


    SELECT a
    USE ordmst orde ord 
    SEEK unt+mordtype+STR(mordno,6)
    IF NOT FOUND()
    DO alrt WITH "Sales Order not found!"
    RETURN .f.
    ENDIF 
    * SELECT COUNT(*) INTO ARRAY cl FROM ordmst WHERE unit="03" AND type=mordtype AND ordno=mordno
    * IF cl=0
    * DO alrt WITH "Sales Order not found!"
    * RETURN .f.
    * ENDIF 
    * SELECT code_S INTO ARRAY cn1 FROM ordmst WHERE unit="03" AND type=mordtype AND ordno=mordno
    STORE code_s TO cn1
    IF soctr=0
    STORE cn1 TO slcd
    ELSE
    IF cn1#slcd
    DO alrt WITH "Buyer mismatched!"
    RETURN .f.
    ENDIF 
    ENDIF 

    IF DATE()>(a->dlvrydate+(a->dlvrydays1+a->dlvrydays2+a->dlvrydays3)) AND a->dlvrydate#CTOD("  /  /  ")
    DO alrt WITH "Last Delivery Date Expired! "+DTOC((a->dlvrydate+(a->dlvrydays1+a->dlvrydays2+a->dlvrydays3)))
    RETURN .f.
    ENDIF 
    USE



    cn1=""
    SELECT name INTO ARRAY cn1 FROM slmst WHERE unit="03" AND code_g=glcd AND code_s=slcd
    @ 4.000,46.000 say cn1 size 1.000,30.000  font "Calibri", 8 ;
    picture "@K!"  color w/rb+



    SELECT item,b.name,(bags-sbags) bpcs,(quantity-sqty) bqty, a.ordno FROM orddtl a, itmstr b ;
    INTO CURSOR idtl ;
    WHERE a.unit=unt AND a.type=mordtype AND a.ordno=mordno ;
    AND b.unit=a.unit AND b.code=a.item
    COPY TO &ff22
    GO top
    @ 7.400,2 clea to 22,130
    lno=6
    DO whil NOT EOF()
    lno=lno+1.5
    @ lno,3.000 get idtl.item size 1.000,10.000  font "Calibri", 10 ;
    picture "@K!"  color w/rb+ styl "B"
    @ lno,16.000 get idtl.name size 1.000,30.000  font "Calibri", 10 ;
    picture "@K!"  color w/rb+ styl "B"
    @ lno,52.000 get idtl.bpcs size 1.000,10.000  font "Calibri", 10 ;
    picture "@K 99999999"  color w/rb+ styl "B"
    @ lno,65.000 get idtl.bqty size 1.000,15.000  font "Calibri", 10 ;
    picture "@K 99999999.999"  color w/rb+ styl "B"
    skip
    endd 
    CLEAR gets
    RETURN
    *--------------------------------*----------------------------------------*
    PROCEDURE selcrtn

    PUBLIC oForm


    oForm= CREATEOBJECT('clsmultigrid')
    oForm.ADDOBJECT('Grid1','Grid')
    *oForm.ADDObject('txt','TextBox') &&With Top = 10, Left = 10
    ***********************************************************

    WITH oForm.Grid1
    .COLUMNCOUNT = 10
    .HEIGHT = 288
    .PANEL = 1
    .WIDTH = 1000 &&700
    .LEFT = 24
    .TOP = 24
    .deletemark = .F.
    .Column1.WIDTH = 17
    .Column1.NAME = "Column1"
    .Column1.Header1.CAPTION = ""
    .Column1.ADDOBJECT('Check1','clscheck')
    .Column1.Check1.VISIBLE = .T.
    .Column1.CURRENTCONTROL = 'Check1'
    .Column1.Text1.VISIBLE = .F.
    .Column1.REMOVEOBJECT('Text1')
    .Column1.SPARSE = .F.
    .Column2.WIDTH = 60  &&148
    .Column2.NAME = "Column2"
    .Column2.Header1.CAPTION = "CNO"
    .Column3.WIDTH = 30  &&114
    .Column3.NAME = "Column3"
    .Column3.Header1.CAPTION = "TYP"
    *.Column3.Text1.INPUTMASK = "(###)###-####"
    .Column4.WIDTH = 30  &&148
    .Column4.NAME = "Column4"
    .Column4.Header1.CAPTION = "GRD"
    .Column5.WIDTH = 50  &&148
    .Column5.NAME = "Column5"
    .Column5.Header1.CAPTION = "PCS"
    .Column6.WIDTH = 60  &&148
    .Column6.NAME = "Column6"
    .Column6.Header1.CAPTION = "QTY"
    .Column7.WIDTH = 200  &&148
    .Column7.NAME = "Column7"
    .Column7.Header1.CAPTION = "Name"
    .Column8.WIDTH = 250  &&148
    .Column8.NAME = "Column8"
    .Column8.Header1.CAPTION = "DSGNAME"
    .Column9.WIDTH = 115  &&148
    .Column9.NAME = "Column9"
    .Column9.Header1.CAPTION = "SORTNO"
    .Column10.WIDTH = 110  &&148
    .Column10.NAME = "Column10"
    .Column10.Header1.CAPTION = "SHADENAME"

    .SETALL('DynamicBackColor', 'IIF(selecter, RGB(0,219,219), RGB(255,255,255))', 'COLUMN')
    .VISIBLE = .T.
    ENDWITH

    oForm.VISIBLE = .T.



    DEFINE CLASS clsmultigrid AS FORM

    TOP = 0
    LEFT = 0
    HEIGHT = 354  &&354
    WIDTH = 1100   &&676
    DOCREATE = .T.
    CAPTION = "Carton Selection"
    WINDOWTYPE = 1
    WINDOWSTATE = 0
    NAME = "clsmultigrid"
    alwaysontop = .T.
    maxbutton=.f.


    PROCEDURE init 
    CREATE CURSOR crsTemp (selecter L, crtnno n(10),crtntype c(1),grade c(1), crtnpcs n(6), crtnqty n(8,3),name c(60),dsgname c(30),sortno c(15), shadename c(15), crtngwt n(8,3),otype c(4),ordno n(6)) 
    INSERT INTO crstemp SELECT mflg,crtnno,crtntype,grade,crtnpcs,crtnqty,name,dsgname,sortno,shadename,crtngwt,ordertype,orderno FROM &ff44 
    GO TOP IN "crsTemp"
    IF msc>0
    REPLACE NEXT msc selecter WITH .t.
    ENDIF 
    SUM crtnpcs TO bg FOR selecter=.t.
    SUM crtnqty TO bq FOR selecter=.t.
    SUM crtngwt TO bgq FOR selecter=.t.
    COUNT TO bc FOR selecter=.t.
    copy TO &ff33 FOR selecter=.t.
    GO TOP IN "crsTemp"
    ENDPROC
    ENDDEFINE



    DEFINE CLASS clscheck AS CHECKBOX
    HEIGHT = 17
    WIDTH = 18
    AUTOSIZE = .T.
    CAPTION = " "
    BackStyle = 0      && Transparent
    Margin = 0
    SpecialEffect = 1 && Plain
    BorderStyle = 0      && None
    NAME = "clscheck"

    PROCEDURE CLICK
    IF DODEFAULT()
    KEYBOARD '{DNARROW}'
    ENDIF

    SUM crtnpcs TO bg FOR selecter=.t.
    SUM crtnqty TO bq FOR selecter=.t.
    SUM crtngwt TO bgq FOR selecter=.t.
    COUNT TO bc FOR selecter=.t.
    copy TO &ff33 FOR selecter=.t.
    @ 21.000,6.000 say bc size 1.000,11.000  font "MS Sans Serif", 8 ;
    picture "@KI 9999"  color w/rb+
    @ 21.000,21.000 say bg size 1.000,11.000  font "MS Sans Serif", 8 ;
    picture "@KI 999999"  color w/rb+
    @ 21.000,33.000 say bq size 1.000,11.000  font "MS Sans Serif", 8 ;
    picture "@KI 99999.999"  color w/rb+
    @ 21.000,47.000 say bgq size 1.000,11.000  font "MS Sans Serif", 8 ;
    picture "@KI 99999.999"  color w/rb+

    ENDPROC
    ENDDEFINE
    * End Code
    *--------------------------------*----------------------------------------*

    Best Regards

    Lakshay

    Tuesday, February 5, 2019 4:28 AM

Answers

  • The grid will respect the underlying properties of the table that it is displaying.  So, in order to filter the grid you need to filter the underlying table.  An easy (for programmers, not for end users) way to create a filter is through GetExpr. You can do something like:

    GETEXPR "Enter filter criteria" TO myfilter DEFAULT ""

    and then

    set filter to &myfilter

    That should filter your grid.

    Tuesday, February 5, 2019 9:00 PM
  • Sorting and filtering aren't built into the grid control. You need code for that. Rather than building it yourself, you should probably use one of the versions that's around. I'm using one from http://www.foxyclasses.com/ in one application. You also might find something in http://sandstorm36.blogspot.com/2015/12/whats-on-ssultimate-library.html.

    Tamar

    Tuesday, February 5, 2019 9:45 PM
    Moderator

All replies

  • The grid will respect the underlying properties of the table that it is displaying.  So, in order to filter the grid you need to filter the underlying table.  An easy (for programmers, not for end users) way to create a filter is through GetExpr. You can do something like:

    GETEXPR "Enter filter criteria" TO myfilter DEFAULT ""

    and then

    set filter to &myfilter

    That should filter your grid.

    Tuesday, February 5, 2019 9:00 PM
  • Sorting and filtering aren't built into the grid control. You need code for that. Rather than building it yourself, you should probably use one of the versions that's around. I'm using one from http://www.foxyclasses.com/ in one application. You also might find something in http://sandstorm36.blogspot.com/2015/12/whats-on-ssultimate-library.html.

    Tamar

    Tuesday, February 5, 2019 9:45 PM
    Moderator