-
Notifications
You must be signed in to change notification settings - Fork 10
/
merged-cells.sql
36 lines (26 loc) · 1.57 KB
/
merged-cells.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
32
33
34
35
36
declare
ctx ExcelGen.ctxHandle;
sheet1 ExcelGen.sheetHandle;
rowIdx pls_integer := 1;
colIdx pls_integer := 1;
alignment1 ExcelTypes.CT_CellAlignment := ExcelGen.makeAlignment(p_horizontal => 'center', p_vertical => 'center');
begin
ctx := ExcelGen.createContext(ExcelGen.FILE_XLSX);
sheet1 := ExcelGen.addSheet(ctx, 'sheet1');
ExcelGen.putCell(ctx, sheet1, 1, 1, anydata.ConvertVarchar2('TEST'), p_style => ExcelGen.makeCellStyle(ctx, p_alignment => alignment1)
);
ExcelGen.putNumberCell(ctx, sheet1, 2, 1, 1, ExcelGen.makeCellStyle(ctx, p_fill => ExcelGen.makePatternFill('solid','chartreuse'), p_alignment => alignment1));
ExcelGen.putNumberCell(ctx, sheet1, 2, 3, 2, ExcelGen.makeCellStyle(ctx, p_fill => ExcelGen.makePatternFill('solid','gold'), p_alignment => alignment1));
ExcelGen.putNumberCell(ctx, sheet1, 4, 1, 3, ExcelGen.makeCellStyle(ctx, p_fill => ExcelGen.makePatternFill('solid','hotpink'), p_alignment => alignment1));
ExcelGen.putNumberCell(ctx, sheet1, 4, 3, 4, ExcelGen.makeCellStyle(ctx, p_fill => ExcelGen.makePatternFill('solid','deepskyblue'), p_alignment => alignment1));
ExcelGen.putStringCell(ctx, sheet1, 3, 2, 'ABC');
ExcelGen.mergeCells(ctx, sheet1, 'A1:D1');
ExcelGen.mergeCells(ctx, sheet1, 'A2:B3');
ExcelGen.mergeCells(ctx, sheet1, 'C2:D3');
ExcelGen.mergeCells(ctx, sheet1, 'A4:B5');
ExcelGen.mergeCells(ctx, sheet1, 'C4:D5');
ExcelGen.setRowProperties(ctx, sheet1, 1, p_height => 30);
ExcelGen.createFile(ctx, 'TEST_DIR', 'merged-cells.xlsx');
ExcelGen.closeContext(ctx);
end;
/