Advanced Printing Apex Report

 

Declare
l_context        apex_exec.t_context;
l_highlights     apex_data_export.t_highlights;
l_export         apex_data_export.t_export;
l_print_config    apex_data_export.t_print_config;
begin
apex_data_export.add_highlight(
p_highlights          => l_highlights,
p_id                  => 1,
p_value_column        => ‘HIGHLIGHT_NAME’,
p_display_column      => null,
p_text_color          => ‘Black’,
p_background_color    =>  ‘Green’);

l_context := apex_exec.open_query_context(
p_location    => apex_exec.c_location_local_db,
p_sql_query   => ‘select nationality, country_code, case when name like ”%G%” then 1 end as HIGHLIGHT_NAME
from eba_countries’ );

l_print_config := apex_data_export.get_print_config(
p_body_font_color             => ‘Black’,
p_page_header                 => ‘Country’,
p_page_header_font_color      => ‘Black’,
p_page_header_font_size       => 14,
p_page_header_font_weight     => apex_data_export.c_font_weight_bold,
p_page_footer                 => ‘Country’,
p_page_footer_font_color      => ‘Black’,
p_page_footer_font_size       => 14,
p_page_footer_font_weight     => apex_data_export.c_font_weight_bold,
p_border_width                => 1,
p_border_color                => ‘Black’);

l_export := apex_data_export.export (
p_context      => l_context,
p_format       => ‘PDF’,
p_print_config => l_print_config,
p_highlights   => l_highlights );

apex_exec.close( l_context );

apex_data_export.download( p_export => l_export );

exception
when others then
apex_exec.close( l_context );
raise;
end;

Comments

Popular posts from this blog

Install and Configure OBIEE 12c on Linux VM

Web Based Electricity Billing and Payment System with SMS Notification

How to create oracle APEX plugins