Skip to main content

Hello, 

I need to get Pdf report sent to the default Printer .when the shipment’s status change to Closed .

 

Thanks,

 

 

Hi @jzouaoui ,

Can you explain bit further? Do you want to get a pdf of already printed or generated report which set for the default printer or do you need to generate a new report when changing the shipment status?

 

Thanks,

Kavindu


Hello Kavin, 

I have an existing shipment report (name  :Dispatch_rep) .I want to get a pdf(Dispatch_rep) already printed to the default printer  . when the shipment status is Closed. 

 

Thank you.


Hi @jzouaoui ,

In your case we may have to save the result key value of the printed report in shipment window or some where else, using a custom or customized field. Then we can re-view that report from report archive in the moment of closing the shipment.  That’s the solution I can think of. 

 

Thanks..


But i need to send it automatically to the Printer . without opening to preview  the shipment Report . 

Scenario : when the shipment status changes ,the report Shipment will be send to the printer .

Thank you.


Hello,

@jzouaoui did you find the solution? I’m looking for the same functionality.

Best regards

Bartłomiej Pobocha


Non :( 


@jzouaoui I think you can use “Scheduled report” optionality to print reports automatically.


@ashen_malaka_ranasinghe for me it is impossible, because of error:
 

report hasn’t any parameters:

is there any other option?


Hı, 

You must write custom Event , when table of Logocal unit rowstate updated.


@alpamuk what function I need to execute in event?


below script connect PDF to existing report archive ADDITIONAL_INV_Q_R_CODE_REP, but I think it can be used for any other reports:

DECLARE

   result_key_ NUMBER := 179065;

   print_ATTR_ VARCHAR2(200);

   PRINT_JOB_ID_ NUMBER;

   LAYOUT_NAME_ VARCHAR2(200);

BEGIN

   CLIENT_SYS.CLEAR_ATTR(print_ATTR_);

   CLIENT_SYS.ADD_TO_ATTR('PRINTER_ID','PDF_PRINTER',PRINT_ATTR_);--printer_id_ := Printer_Connection_API.Get_Default_Printer(Fnd_Session_API.Get_Fnd_User, 'ADDITIONAL_INV_Q_R_CODE_REP');

   PRINT_JOB_API.NEW(PRINT_JOB_ID_, print_ATTR_);

   LAYOUT_NAME_ := REPORT_LAYOUT_DEFINITION_API.GET_DEFAULT_LAYOUT('ADDITIONAL_INV_Q_R_CODE_REP');

   CLIENT_SYS.CLEAR_ATTR(print_ATTR_);

   CLIENT_SYS.ADD_TO_ATTR('PRINT_JOB_ID',PRINT_JOB_ID_,print_ATTR_);

   CLIENT_SYS.ADD_TO_ATTR('RESULT_KEY',result_key_,print_ATTR_);

   CLIENT_SYS.ADD_TO_ATTR('LAYOUT_NAME',LAYOUT_NAME_,print_ATTR_);

   CLIENT_SYS.ADD_TO_ATTR('OPTIONS','COPIES(1)',print_ATTR_);

   CLIENT_SYS.ADD_TO_ATTR('LANG_CODE','en',print_ATTR_);

   CLIENT_SYS.ADD_TO_ATTR('LOCALE_LANGUAGE','en',print_ATTR_);

   CLIENT_SYS.ADD_TO_ATTR('LOCALE_COUNTRY','US',print_ATTR_);

   PRINT_JOB_CONTENTS_API.NEW_INSTANCE(print_ATTR_);

   PRINT_JOB_API.PRINT(PRINT_JOB_ID_);

END;  


@bartlomiej.pobocha  i would thank you about the reply and i have a question Please . Where did you get the result Key number ?


Hello @jzouaoui, from archive_tab:
 

 


@jzouaoui You can use a custom event to print the PDF automatically


Reply