How can customize Oracle APEX Print PDF header & show Image

 DECLARE

    l_columns         apex_data_export.t_columns;

    l_context         apex_exec.t_context;
    l_export          apex_data_export.t_export;
    l_print_config    apex_data_export.t_print_config;
BEGIN

l_context := apex_exec.open_query_context(
    p_location    => apex_exec.c_location_local_db,
    p_sql_query   => 'select * FROM emp order by deptno' );


-- Define columns

apex_data_export.add_column(
            p_columns          => l_columns,
            p_name             => 'DEPTNO',
            p_heading          => 'Dept No');

apex_data_export.add_column(
            p_columns           => l_columns,
            p_name              => 'EMPNO',
            p_heading           => 'Emp No');

apex_data_export.add_column(
            p_columns => l_columns,
            p_name    => 'ENAME',
            p_heading => 'Emp Name');

apex_data_export.add_column( 
            p_columns           => l_columns,
            p_name              => 'SAL',
            p_heading           => 'Salary',
            p_format_mask       => 'FML999G999G999G999G990D00');



l_print_config := apex_data_export.get_print_config(
            p_orientation                 => apex_data_export.c_orientation_portrait,
            p_border_width                => 1,
            p_body_font_color             => 'Black',

            p_page_header                 => 'Dekko Legacy Group',
            p_page_header_font_color      => 'Black',
            p_page_header_font_size       => 20,
            p_page_header_font_family      => null,
            p_page_header_font_weight     => apex_data_export.c_font_weight_bold,
            p_page_header_alignment       => 'CENTER',

            p_page_footer                 => 'Generated by '|| :APP_USER,
            p_page_footer_font_color      => 'Black',
            p_page_footer_font_size       => 10,
            p_page_footer_font_family      => null,
            p_page_footer_font_weight     => apex_data_export.c_font_weight_bold,     
            p_page_footer_alignment       => 'LEFT',
            
            p_border_color                => 'Black');

l_export := apex_data_export.export (
            p_context        => l_context,
            p_format         => :P32_FORMAT,--apex_data_export.c_format_pdf,
            p_columns        => l_columns,
            p_file_name      => 'employees',
            p_print_config   => l_print_config
            );


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

Project Management System ER Diagram

Web Based Electricity Billing and Payment System with SMS Notification