-
Notifications
You must be signed in to change notification settings - Fork 10
/
multisheet-paginated.sql
31 lines (23 loc) · 1.19 KB
/
multisheet-paginated.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
29
30
31
declare
ctxId ExcelGen.ctxHandle;
sheet1 ExcelGen.sheetHandle;
sheet2 ExcelGen.sheetHandle;
sheet3 ExcelGen.sheetHandle;
begin
ctxId := ExcelGen.createContext();
-- adding a new sheet in position 3
sheet1 := ExcelGen.addSheetFromQuery(ctxId, 'c', 'select * from hr.employees where department_id = :1', p_sheetIndex => 3);
ExcelGen.setBindVariable(ctxId, sheet1, '1', 30);
ExcelGen.setTableFormat(ctxId, sheet1, 'TableStyleLight1');
ExcelGen.setHeader(ctxId, sheet1, p_autoFilter => true, p_frozen => true);
-- adding a new sheet in last position (4)
sheet2 := ExcelGen.addSheetFromQuery(ctxId, 'b', 'select * from hr.employees');
ExcelGen.setTableFormat(ctxId, sheet2, 'TableStyleLight2');
ExcelGen.setHeader(ctxId, sheet2, p_autoFilter => true, p_frozen => true);
-- adding a new sheet in position 1, with a 10-row pagination
sheet3 := ExcelGen.addSheetFromQuery(ctxId, 'a${PNUM}', 'select * from hr.employees', p_paginate => true, p_pageSize => 10, p_sheetIndex => 1);
ExcelGen.setHeader(ctxId, sheet3, p_autoFilter => true, p_frozen => true);
ExcelGen.createFile(ctxId, 'TEST_DIR', 'multisheet-paginated.xlsx');
ExcelGen.closeContext(ctxId);
end;
/