Hi,
In Sales Order Form there is a print receipt button. In current situation On Clicking the 'Print Receipt Button' it submits a XML Publisher report(PDF output) to the concurrent manager. Currently to print that report i need to go view--> requests--> view output and then print. According to my new Requirement i need to print that report directly to local printer on one simple Print receipt button click in form.
I am trying to call the printers on server using custom.pll. The report is running successfully but it is not printing output to the local printer. I need to print the report to the local printers based on responsibility. Local printers are available on apps server. Can anyone help me on this issue ASAP.
Is it possible to print the document using custom.pll? Is there any other alternative to print the report on simple button click in form.
I searched many forums but i found customizations on form level. I am trying to customize the form using custom.pll.
I found many examples like (http://www.orafaq.com/forum/m/208076/104372/?srch=Print+report+automatically#msg_208076) but i dont think i can use these practices in custom.pll. ADD_PARAMETER & RUN_PRODUCT dont work in custom.pll. This is very urgent requirement and i am suffering with this problem from 1 week.
I need to complete this requirement immediately. Can anyone suggest me better ways in doing this. Am i following the right track?. Plz guide me
Environment: Apps 11.5.10.2, Forms 6i
Here is the code that i am using in my custom.pll.
if (v_form_name = 'OEXOETEL' --and v_block_name = 'LINES_SUMMARY'
and name_in('parameter.ACTIONS') = 'PAYMENT_RECEIPT' )THEN
l_organization_id := Name_In('PARAMETER.OE_ORGANIZATION_ID');
l_order_header_id := Name_In('ORDER.header_id');
select to_number(oe_sys_parameters.value ('SET_OF_BOOKS_ID')) into l_sob_id from dual;
xml_layout := FND_REQUEST.ADD_LAYOUT('XXAFP','XXAFPOEXPMTRCRTF','en','US','PDF');
select a.profile_option_value
into v_printer_name
from fnd_profile_option_values a
, fnd_profile_options b
, fnd_profile_options_tl c
, fnd_user fu
where a.profile_option_id = b.profile_option_id
and c.profile_option_name = b.profile_option_name
and fu.user_id (+) = a.level_value
and c.language = 'US'
and c.user_profile_option_name='Printer'
and a.level_id = 10003 ;
if (FND_SUBMIT.SET_PRINT_OPTIONS(v_printer_name, 'Portrait', 2, TRUE, 'N'))
then
l_new_request_id := FND_REQUEST.SUBMIT_REQUEST('XXAFP','XXAFPOEXPMTRC',
null,null,FALSE,l_sob_id,l_organization_id,NULL,NULL,l_order_header_id,
chr(0), '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '');
end if;
fnd_message.set_string('Request Submitted for Custom Payment Receipt. Request ID is '||l_new_request_id);
fnd_message.show;
copy('NULL','parameter.ACTIONS');
IF (l_new_request_id = 0) THEN
FND_MESSAGE.RETRIEVE;
FND_MESSAGE.ERROR;
else
l_commit_result := APP_FORM.QuietCommit;
END IF;
Thanks for taking time to read this
Thanks,
Srinivas
|