Skip to main content
Question

How to Print Pdf report automatically


jzouaoui
Sidekick (Customer)
Forum|alt.badge.img+8

Hello, 

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

 

Thanks,

 

 

14 replies

kavinduxo
Hero (Partner)
Forum|alt.badge.img+9
  • Hero (Partner)
  • 41 replies
  • March 2, 2022

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


jzouaoui
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • 36 replies
  • March 2, 2022

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.


kavinduxo
Hero (Partner)
Forum|alt.badge.img+9
  • Hero (Partner)
  • 41 replies
  • March 3, 2022

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


jzouaoui
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • 36 replies
  • March 3, 2022

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.


Forum|alt.badge.img+8

Hello,

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

Best regards

Bartłomiej Pobocha


jzouaoui
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • 36 replies
  • February 6, 2023

Non :( 


ashen_malaka_ranasinghe
Hero (Employee)
Forum|alt.badge.img+11

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


Forum|alt.badge.img+8

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

report hasn’t any parameters:

is there any other option?


Forum|alt.badge.img+7
  • Sidekick
  • 11 replies
  • February 6, 2023

Hı, 

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


Forum|alt.badge.img+8

@alpamuk what function I need to execute in event?


Forum|alt.badge.img+8

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;  


jzouaoui
Sidekick (Customer)
Forum|alt.badge.img+8
  • Author
  • Sidekick (Customer)
  • 36 replies
  • May 3, 2023

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


Forum|alt.badge.img+8

Hello @jzouaoui, from archive_tab:
 

 


Forum|alt.badge.img+7
  • Do Gooder
  • 11 replies
  • October 24, 2023

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings