Пример отчета созданного с помощью as_xlsx

declare
iNUM integer:=1;
nTOTAL_SUMM number:=0;
sDATE varchar2(100);
begin
as_xlsx.clear_workbook;
as_xlsx.new_sheet('автозамеры');

/* ширина колонок */
as_xlsx.set_column_width(1, 36);
as_xlsx.set_column_width(2, 26);
as_xlsx.set_column_width(3, 10);
as_xlsx.set_column_width(4, 10);
as_xlsx.set_column_width(5, 10);
as_xlsx.set_column_width(6, 30);
as_xlsx.set_column_width(7, 13);
as_xlsx.set_column_width(8, 13);
as_xlsx.set_column_width(9, 18);

/* заголовок */
as_xlsx.set_row( iNUM, p_fontId => as_xlsx.get_font( 'Times New Roman', p_fontsize =>14, p_bold => true ) ) ;
as_xlsx.cell( 1, iNUM, 'Состояние автозамеров по  ООО "продукт"', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center' ) );
as_xlsx.mergecells( 1, iNUM, 9, iNUM );

/* дата с объединением строк*/
select 'по состоянию на ' || to_char(sysdate+1/12, 'dd.mm.yyyy hh24:mi') into sDATE from DUAL;
iNUM:=iNUM+1;
as_xlsx.cell(1, iNUM, sDATE, p_fontId => as_xlsx.get_font( 'Times New Roman', p_fontsize =>14 ), p_alignment => as_xlsx.get_alignment( p_horizontal => 'center' ));
as_xlsx.mergecells( 1, iNUM, 9, iNUM );

/* пустая строка */
iNUM:=iNUM+1;
as_xlsx.cell(1, iNUM, '');

/* шапка таблицы */
iNUM:=iNUM+1;
as_xlsx.set_row( iNUM, p_fontId => as_xlsx.get_font( 'Times New Roman', p_fontsize =>10 ),
p_fillId => as_xlsx.get_fill( 'solid', 'FFFF99' ),
p_borderId => as_xlsx.get_border) ;

as_xlsx.cell(1, iNUM, 'Головная организация', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(2, iNUM, 'Наименование АЗС', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(3, iNUM, 'Автозамер', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(4, iNUM, 'Частичный автозамер', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(5, iNUM, 'Полный автозамер', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(6, iNUM, 'Примечание (резервуар - продукт - состояние канала - последняя заявка)', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(7, iNUM, 'Всего сырых замеров за 24 ч (резервуар - количество)', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(8, iNUM, 'Нулевых сырых замеров за 24 ч (резервуар - количество)', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(9, iNUM, 'Последний замер (дата - тип)', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));

/* нумерация колонок */
iNUM:=iNUM+1;
as_xlsx.set_row( iNUM, p_fontId => as_xlsx.get_font( 'Times New Roman', p_fontsize =>10 ),
p_fillId => as_xlsx.get_fill( 'solid', 'FFFF99' ),
p_borderId => as_xlsx.get_border) ;

as_xlsx.cell(1, iNUM, '1', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(2, iNUM, '2', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(3, iNUM, '3', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(4, iNUM, '4', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(5, iNUM, '5', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(6, iNUM, '6', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(7, iNUM, '7', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(8, iNUM, '8', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));
as_xlsx.cell(9, iNUM, '9', p_alignment => as_xlsx.get_alignment( p_horizontal => 'center', p_vertical => 'center', p_wraptext => true ));

/* заполнение таблицы */
for cur in (select 1 as num, 'test' as name, 123 as s, 1 as summ from dual connect by rownum <=5) loop iNUM:=iNUM+1; nTOTAL_SUMM:=nTOTAL_SUMM+cur.summ; as_xlsx.set_row( iNUM, p_fontId => as_xlsx.get_font( 'Times New Roman', p_fontsize =>9 ), p_borderId => as_xlsx.get_border ) ;
as_xlsx.cell( 1, iNUM, cur.num);
as_xlsx.cell( 2, iNUM, cur.name);
as_xlsx.cell( 3, iNUM, cur.s);
as_xlsx.cell( 4, iNUM, cur.summ);
as_xlsx.cell( 5, iNUM, '');
as_xlsx.cell( 6, iNUM, '');
as_xlsx.cell( 7, iNUM, '');
as_xlsx.cell( 8, iNUM, '');
as_xlsx.cell( 9, iNUM, '');
end loop;

/* итоги 1 */
iNUM:=iNUM+1;
as_xlsx.set_row( iNUM, p_fontId => as_xlsx.get_font( 'Times New Roman', p_fontsize =>10, p_bold =>true  ),
p_fillId => as_xlsx.get_fill( 'solid', 'CCFFFF' ),
p_borderId => as_xlsx.get_border) ;
as_xlsx.cell( 1, iNUM, '');
as_xlsx.cell( 2, iNUM, '');
as_xlsx.cell( 3, iNUM, '');
as_xlsx.cell( 4, iNUM, '');
as_xlsx.cell( 5, iNUM, '');
as_xlsx.cell( 6, iNUM, '');
as_xlsx.cell( 7, iNUM, '');
as_xlsx.cell( 8, iNUM, '');
as_xlsx.cell( 9, iNUM, '');

/* итоги 2 */
iNUM:=iNUM+1;
as_xlsx.set_row( iNUM, p_fontId => as_xlsx.get_font( 'Times New Roman', p_fontsize =>10, p_bold =>true ),
p_fillId => as_xlsx.get_fill( 'solid', 'CCFFCC' ),
p_borderId => as_xlsx.get_border) ;
as_xlsx.cell( 1, iNUM, 'ИТОГО:');
as_xlsx.cell( 2, iNUM, '');
as_xlsx.cell( 3, iNUM, '');
as_xlsx.cell( 4, iNUM, nTOTAL_SUMM);
as_xlsx.cell( 5, iNUM, '');
as_xlsx.cell( 6, iNUM, '');
as_xlsx.cell( 7, iNUM, '');
as_xlsx.cell( 8, iNUM, '');
as_xlsx.cell( 9, iNUM, '');

as_xlsx.save( 'DMPDIR', 'my.xlsx' );

end;
/