Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
stra = "SELECT cDesignation as Designation, CAST(0 as bit) as Select FROM HRIS.dbo.vHRIS_Deletion WHERE cFact=?_Fact AND cDesignation <> 'NULL' GROUP BY cDesignation ORDER BY cDesignation "
CAST(0 as bit) as Select
PUBLIC oForm
oForm = NEWOBJECT("frmForm")
oForm.Show
Read Events
Close all
Clear All
RETURN
**********
DEFINE CLASS chkBox AS CheckBox
Visible = .T.
Caption = ""
PROCEDURE Click()
This.Parent.Parent.Refresh()
ENDPROC
ENDDEFINE
**********
DEFINE CLASS frmForm AS Form
AutoCenter = .T.
Caption = "Grid - multi selecting from cursor"
Height = 480
Width = 600
MinHeight = This.Height
MinWidth = This.Width
Themes = .F.
ADD OBJECT lblOData AS Label WITH ;
Caption = "Original Data", ;
Left = 12, ;
Top = 42, ;
Anchor = 3
ADD OBJECT lblSelection AS Label WITH ;
Caption = "Results", ;
Left = 300, ;
Top = 42, ;
Anchor = 3
ADD OBJECT grdGrid AS Grid WITH ;
ColumnCount = -1, ;
Left = 12, ;
Top = 60, ;
Width = 270, ;
Height = 396, ;
Anchor = 1 + 2 + 4, ;
RecordSource = "curTemp"
PROCEDURE grdGrid.Init()
WITH this
.SetAll("DynamicBackcolor", "IIF(curtemp.f3, RGB(0,125,125), RGB(255,255,255))","Column")
.SetAll("DynamicForecolor", "IIF(curtemp.f3, RGB(255,255,255), RGB(0,0,0))","Column")
.Column1.ReadOnly = .T.
.Column2.ReadOnly = .T.
ENDWITH
WITH This.Column3
.Sparse = .F.
.AddObject("chkBoxSelection", "chkBox")
.CurrentControl = "chkBoxSelection"
ENDWITH
ENDPROC
ADD OBJECT grdResults AS Grid WITH ;
ColumnCount = -1, ;
Left = 300, ;
Top = 60, ;
Width = 270, ;
Height = 396, ;
Anchor = 1 + 2 + 4 + 8, ;
Visible = .F.
ADD OBJECT cmdSearch AS CommandButton WITH ;
Left = 12, ;
Top = 12, ;
Height = 24, ;
Width = 90, ;
Caption = "SQL"
PROCEDURE cmdSearch.Click()
SELECT f1, f2, ALLTRIM(SUBSTR(f2,4)) + ALLTRIM(STR(f1)) as f6, INT(f1/4) as f5, f3 FROM curTemp WHERE f3 ;
ORDER BY 1 ;
INTO CURSOR curTemp2
IF _tally > 0
WITH Thisform.grdResults
.Visible = .T.
.ColumnCount = -1
.RecordSource = "curTemp2"
.DeleteColumn()
ENDWITH
ELSE
Thisform.grdResults.Visible = .F.
ENDIF
Thisform.Refresh()
ENDPROC
ADD OBJECT cmdReset AS CommandButton WITH ;
Left = 300, ;
Top = 12, ;
Height = 24, ;
Width = 90, ;
Caption = "Reset"
PROCEDURE cmdReset.Click()
IF FILE("curtemp2")
SELECT curtemp2
USE
ENDIF
WITH Thisform.grdResults
.Visible = .F.
ENDWITH
SELECT curtemp
UPDATE curTemp SET f3 = .F.
LOCATE
Thisform.Refresh()
ENDPROC
PROCEDURE Destroy
ThisForm.Release()
Clear Events
ENDPROC
PROCEDURE Load
CREATE CURSOR curTemp (f1 I AUTOINC NEXTVALUE 1 STEP 1, f2 C(20), f3 L)
FOR i = 1 TO 50
INSERT INTO curTemp (f2, f3) VALUES ("T" + SYS(2015), .F. )
ENDFOR
LOCATE
ENDPROC
ENDDEFINE
**********