Skip to main content

Hi,

 

i have report layout with excel template and it is working fine manualy. 

Unfortunately i can get excel output only pressing preview button on print dialog. 

my question is is it posible to get excel file directly with menu item plsql code

i have created a code and it is running report but file creating in archive. 

 

DECLARE

layout_name_ VARCHAR2(30) := 'EngPartStructuresRepExcel.rpl';
report_id_ VARCHAR2(30) := 'ENG_PART_STRUCTURES_REP';
report_attr_ VARCHAR2(2000):= '';
parameter_attr_ VARCHAR2(2000):= '';
instance_attr_ VARCHAR2(2000):= '';
print_attr_ VARCHAR2(2000):= '';
attr_ VARCHAR2(2000):= '';
distribution_list_ VARCHAR2(2000):= '';
print_job_id_ VARCHAR2(2000):= '';
printer_id_ VARCHAR2(2000):= 'No Printout,SERVER,NO_PRINTOUT';
result_key_ VARCHAR2(2000):= '';
rev_no_ VARCHAR2(2000):= '';

BEGIN

rev_no_ := Part_Revision_API.Get_Eng_Revision (&CONTRACT,&PART_NO,&ENG_CHG_LEVEL);


Client_SYS.Clear_Attr(report_attr_);
Client_SYS.Add_To_Attr('REPORT_ID', report_id_, report_attr_);
Client_SYS.Add_To_Attr('LAYOUT_NAME', layout_name_, report_attr_);


Client_SYS.Clear_Attr(parameter_attr_);
Client_SYS.Add_To_Attr('PART_NO', &PART_NO, parameter_attr_);
Client_SYS.Add_To_Attr('PART_REV', rev_no_, parameter_attr_);
Client_SYS.Clear_Attr(print_attr_);



Archive_API.New_Client_Report(result_key_, report_attr_, parameter_attr_, distribution_list_, print_attr_);
Archive_API.Get_Info(instance_attr_, parameter_attr_, result_key_);
Client_SYS.Clear_Attr(attr_);

Client_SYS.Add_To_Attr('PRINTER_ID', printer_id_, attr_);
Print_Job_API.New(print_job_id_, attr_);

Client_SYS.Add_To_Attr('PRINT_JOB_ID', print_job_id_, instance_attr_);
client_SYS.Add_To_Attr('RESULT_KEY', result_key_, instance_attr_);
Client_SYS.Add_To_Attr('OPTIONS', 'COPIES(1)', instance_attr_);
Print_Job_Contents_API.New_Instance(instance_attr_);
Print_Job_API.Print(print_job_id_);

END;

 

Be the first to reply!

Reply