Excel Output Directly From Oracle Application Concurrent Request
Excel Output Directly From Oracle Application Concurrent Request
rename it to owa_sylk_apps
Change it to use fnd_file.put_line(fnd_file.output instead of
utl_file.put_line(g_file
Remove parameters for p_file
2. Create a PL/SQL package for the concurrent program that outputs SYLK file to the
concurrent request output.
create or replace package XXXV8_USERS_SYLK_PKG AUTHID CURRENT_USER
AS
procedure main
( errbuf
out varchar2
, retcode
out varchar2
, p_date_from in varchar2
, p_date_to in varchar2
);
end XXXV8_USERS_SYLK_PKG;
/
create or replace package body XXXV8_USERS_SYLK_PKG
AS
procedure main
( errbuf
out varchar2
, retcode
out varchar2
, p_date_from in varchar2
, p_date_to in varchar2
) as
l_date_from date;
l_date_to date;
begin
l_date_from := fnd_date.canonical_to_date(p_date_from);
l_date_to := fnd_date.canonical_to_date(p_date_to);
owa_sylk_apps.show(
p_query => select user_id user_id, user_name user_name,
from fnd_user
where trunc(creation_date) >
ATE_FROM
ATE_TO ,
p_parm_names =>
owa_sylk_apps.owaSylkArray( DATE_FROM, DATE_TO),
p_parm_values =>
owa_sylk_apps.owaSylkArray(l_date_from ,l_date_to),
p_widths =>
owa_sylk_apps.owaSylkArray(20,20,20,20)
);
end main;
END XXXV8_USERS_SYLK_PKG;
3. Setup the concurrent program
4. Hijack one of the little used Viewer Options (PCL) so that we can get the
Concurrent Request output browser to automatically open Microsoft Excel. Note this is
optional, you can just create a new Viewer Option but then you may get the Choose
Viewer box when viewing concurrent request output. NB: Navigation path is System
Administrator, Install, Viewer Options
update fnd_mime_types_tl
set mime_type = application/vnd.ms-excel
,
description = Excel (SYLK) used to be application/vnd.hp-PCL: Printer Control
Language
,
last_updated_by = 0
last_update_date = sysdate