1 Reply Latest reply: Apr 27, 2007 10:43 AM by 524612 RSS

    Very Urgent! Print Report output to local printer on button click in form

    524612
      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.

      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;

      I need to complete this requirement immediately. Can anyone suggest me better ways in doing this.



      Thanks,

      Srinivas