Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stephan Wald
committed
Feb 26, 2018
1 parent
4be6774
commit 294aa26
Showing
1 changed file
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
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 | ||
|