-
Notifications
You must be signed in to change notification settings - Fork 10
/
dept-emp.sql
28 lines (20 loc) · 858 Bytes
/
dept-emp.sql
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
declare
ctxId ExcelGen.ctxHandle;
sheet1 ExcelGen.sheetHandle;
sheet2 ExcelGen.sheetHandle;
begin
ctxId := ExcelGen.createContext();
-- add dept sheet
sheet1 := ExcelGen.addSheetFromQuery(ctxId, 'dept', 'select * from hr.departments');
ExcelGen.setHeader(ctxId, sheet1, p_autoFilter => true);
ExcelGen.setTableFormat(ctxId, sheet1, 'TableStyleLight2');
-- add emp sheet
sheet2 := ExcelGen.addSheetFromQuery(ctxId, 'emp', 'select * from hr.employees where salary >= :1 order by salary desc');
ExcelGen.setBindVariable(ctxId, sheet2, '1', 7000);
ExcelGen.setHeader(ctxId, sheet2, p_autoFilter => true);
ExcelGen.setTableFormat(ctxId, sheet2, 'TableStyleLight7');
ExcelGen.setDateFormat(ctxId, 'dd/mm/yyyy');
ExcelGen.createFile(ctxId, 'TEST_DIR', 'dept-emp.xlsx');
ExcelGen.closeContext(ctxId);
end;
/