-
Notifications
You must be signed in to change notification settings - Fork 7
/
JLibDemo.bbj
68 lines (48 loc) · 1.62 KB
/
JLibDemo.bbj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use com.basiscomponents.db.DataRow
use com.basiscomponents.db.ResultSet
use com.basiscomponents.db.importer.JLibResultSetImporter
use ::BBjGridExWidget/BBjGridExWidget.bbj::BBjGridExWidget
? 'HIDE'
declare ResultSet rs!
declare DataRow filter!
declare JLibResultSetImporter importer!
declare auto BBjTopLevelWindow wnd!
declare auto BBjListButton lb_db!
declare auto BBjListButton lb_tbl!
declare auto BBjToolButton btn_fit!
declare BBjGridExWidget grid!
wnd! = BBjAPI().openSysGui("X0").addWindow(10,10,800,600,"BBj Grid Ex Demo - fill directly from physical file with JLib")
grid! = new BBjGridExWidget(wnd!,100,0,0,800,600)
wnd! .setCallback(BBjAPI.ON_CLOSE,"byebye")
wnd! .setCallback(BBjAPI.ON_RESIZE,"resize")
gosub fillGrid
process_events
fillGrid:
sqlopen (1)"ChileCompany"
sqlprep (1)"GET TABLE INFO FOR CUSTOMER"
sqlexec (1)
dim tmp$:sqltmpl(1)
tmp$=sqlfetch(1)
sqlclose (1)
dataFile$ = tmp.filename$
template$ = tmp.template$
importer! = new JLibResultSetImporter()
importer!.setFile(dataFile$, template$)
REM rem Filter to get a range of records
REM filter! = new DataRow()
REM filter!.setFieldValue("FILTER_KNUM", "0")
REM rem KNUM 0 = CUST_NUM; is default but showing here for education
REM
REM filter!.setFieldValue("FILTER_RANGE_FROM", "000002")
REM filter!.setFieldValue("FILTER_RANGE_TO", "000010")
REM
REM importer!.setFilter(filter!)
rs! = importer!.retrieve()
grid!.setData(rs!)
return
byebye:
bye
resize:
ev! = BBjAPI().getLastEvent()
grid!.setSize(ev!.getWidth(),ev!.getHeight())
return