v_style. ' ' || v_array_range || ' ' || v_formula || '>' || v_type || p_text || ''); END;
--****************************************************************************** -- Procedure: 示例代码 -- 版本: 1.0 -- Author: 刘峰 --****************************************************************************** PROCEDURE report_sample(errbuf OUT VARCHAR2, retcode OUT VARCHAR2) IS g_date_style. VARCHAR2(10) := 's3'; --普通日期型 g_date_h_style. VARCHAR2(10) := 's4'; --高亮日期型 g_number_style. VARCHAR2(10) := 's5'; --普通会计数字 g_number_h_style. VARCHAR2(10) := 's6'; --高亮会计数字 g_normal_h_style. VARCHAR2(10) := 's7'; --通用型 g_normal_style. VARCHAR2(10) := 's8'; --高亮通用型 g_number4_style. VARCHAR2(10) := 's9'; --普通会计数字(保留4位小数) g_number4_h_style. VARCHAR2(10) := 's10'; --高亮会计数字(保留4位小数) v_person VARCHAR2(50); BEGIN --获取提交人名称 BEGIN SELECT t.full_name INTO v_person FROM per_all_people_f t WHERE t.person_id = (SELECT fu.employee_id FROM fnd_user fu WHERE fu.user_id = fnd_global.user_id) AND nvl(t.effective_end_date, SYSDATE + 1) > SYSDATE; EXCEPTION WHEN OTHERS THEN SELECT fu.user_name INTO v_person FROM fnd_user fu WHERE fu.user_id = fnd_global.user_id; END; --定义XML头信息 cux_common_report_util_pkg.sheet_start(p_author => v_person, p_creation_date => to_char(SYSDATE, 'yyyy-mm-dd hh:mi:ss'), p_company_name => 'XXXXXX', p_report_name => '测试报表'); --表格开始 cux_common_report_util_pkg.table_start; --定义列 cux_common_report_util_pkg.define_column(150); cux_common_report_util_pkg.define_column(150); cux_common_report_util_pkg.define_column(150); cux_common_report_util_pkg.define_column(150); cux_common_report_util_pkg.define_column(150); cux_common_report_util_pkg.define_column(150); cux_common_report_util_pkg.define_column(150); cux_common_report_util_pkg.define_column(150); cux_common_report_util_pkg.define_column(150); cux_common_report_util_pkg.define_column(150); --输出报表标题 cux_common_report_util_pkg.rpt_header('测试报表', 9); --输出报表参数 cux_common_report_util_pkg.row_start; cux_common_report_util_pkg.rpt_parameter('参数1: WELCOME', 2); cux_common_report_util_pkg.rpt_parameter('参数2: HELLO', 2); cux_common_report_util_pkg.row_end; --输出报表列标题 cux_common_report_util_pkg.row_start; cux_common_report_util_pkg.rpt_title('普通字符型'); cux_common_report_util_pkg.rpt_title('高亮字符型'); cux_common_report_util_pkg.rpt_title('普通数字型'); cux_common_report_util_pkg.rpt_title('高亮数字型'); cux_common_report_util_pkg.rpt_title('会计数字型'); cux_common_report_util_pkg.rpt_title('高亮会计数字型'); cux_common_report_util_pkg.rpt_title('普通日期型'); cux_common_report_util_pkg.rpt_title('高亮日期型'); cux_common_report_util_pkg.rpt_title('普通公式列'); cux_common_report_util_pkg.rpt_title('高亮公式列'); cux_common_report_util_pkg.row_end; --输出报表明细 cux_common_report_util_pkg.row_start; --字符类型 cux_common_report_util_pkg.rpt_detail(p_text => '王小二', p_type => 'String', p_style. => g_normal_style); cux_common_report_util_pkg.rpt_detail(p_text => '男性', p_type => 'String', p_style. => g_normal_h_style); --数值类型 cux_common_report_util_pkg.rpt_detail(p_text => '1234.345', p_type => 'Number', p_style. => g_normal_style); cux_common_report_util_pkg.rpt_detail(p_text => '345.456', p_type => 'Number', p_style. => g_normal_h_style); cux_common_report_util_pkg.rpt_detail(p_text => '34324.345', p_type => 'Number', p_style. => g_number_style); cux_common_report_util_pkg.rpt_detail(p_text => '34324.345', p_type => 'Number', p_style. => g_number_h_style); --日期类型 cux_common_report_util_pkg.rpt_detail(p_text => to_char(trunc(SYSDATE), 'yyyy-mm-dd'), p_type => 'DateTime', p_style. => g_date_style); cux_common_report_util_pkg.rpt_detail(p_text => to_char(trunc(SYSDATE), 'yyyy-mm-dd'), p_type => 'DateTime', p_style. => g_date_h_style); --公式类型 cux_common_report_util_pkg.rpt_detail(p_text => NULL, p_formula => '=rc[-6]+rc[-5]', p_type => 'Number', p_style. => g_number_style); cux_common_report_util_pkg.rpt_detail(p_text => NULL, p_formula => '=rc[-5]+rc[-4]', p_type => 'Number', p_style. => g_number_h_style); cux_common_report_util_pkg.row_end; --表格结束 cux_common_report_util_pkg.table_end; --工作表结束 cux_common_report_util_pkg.sheet_end; END;
END cux_common_report_util_pkg; |