brws-jasper.p
1 |
DEF TEMP-TABLE tt FIELD f1 AS INTEGER column-label "Test" format "$ >>>>9" |
---|---|
2 |
FIELD f2 AS character format "x(90)" |
3 |
FIELD f3 AS LOGICAL |
4 |
field f4 as character. |
5 |
|
6 |
def button pdf label "PDF". |
7 |
def button xls label "XLS". |
8 |
def button xlsx label "XLSX". |
9 |
def button csv label "CSV". |
10 |
def var i as integer. |
11 |
repeat i = 1 to 200: |
12 |
CREATE tt. tt.f1 = i * 100. |
13 |
tt.f2 = "second " + string(i). |
14 |
tt.f3 = IF i MOD 2 = 1 THEN YES ELSE NO. |
15 |
tt.f4 = "text". |
16 |
end. |
17 |
|
18 |
DEFINE QUERY q FOR tt SCROLLING. |
19 |
OPEN QUERY q FOR EACH tt. |
20 |
|
21 |
DEF BROWSE br QUERY q |
22 |
DISPLAY |
23 |
tt.f1 |
24 |
tt.f2 |
25 |
tt.f3 |
26 |
tt.f4 |
27 |
WITH size-chars 50 by 10 TITLE "Static browse" separators. |
28 |
|
29 |
DEF FRAME fr br SKIP(1) pdf xls xlsx csv |
30 |
WITH TITLE "Frame" SIZE 70 BY 15 NO-LABELS. |
31 |
|
32 |
on choose of pdf do: |
33 |
browse br:report:export-report-pdf("BrowseReport.pdf"). |
34 |
message "Report done". |
35 |
end. |
36 |
|
37 |
on choose of xls do: |
38 |
browse br:report:export-report-xls("BrowseReport.xls"). |
39 |
message "Report done". |
40 |
end. |
41 |
|
42 |
on choose of xlsx do: |
43 |
browse br:report:export-report-xlsx("BrowseReport.xlsx"). |
44 |
message "Report done". |
45 |
end. |
46 |
|
47 |
on choose of csv do: |
48 |
browse br:report:export-report-csv("BrowseReport.csv"). |
49 |
message "Report done". |
50 |
end. |
51 |
|
52 |
|
53 |
ENABLE ALL WITH FRAME fr. |
54 |
|
55 |
WAIT-FOR WINDOW-CLOSE OF DEFAULT-WINDOW. |
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|