Skip to main content
Solved

How to silently print a report and check-in that to document management


tharindukshan
Sidekick (Employee)
Forum|alt.badge.img+7

Hi,

I am working the purchase order screen and introduced a new command. When the user click this command a report should generate for the purchase order and automatically check-in that to document management. (Here print dialog is not opening)

How to achieve this in the server side?

Regards,
Tharindu

Best answer by tharindukshan

Thank you @Mathias Dahl @ChanakaAmarasekara & @dsj for the support.
With all your help and this post I was able to achieve the result I expected. :)

Regards,

Tharindu

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

12 replies

Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • 2822 replies
  • March 23, 2021

Hi Tharindu,

I think you can do this with the report rule engine. And someone discussed this, or something similar, here:

https://community.ifs.com/topic/show?tid=5723&fid=43

/Mathias

 


tharindukshan
Sidekick (Employee)
Forum|alt.badge.img+7
  • Author
  • Sidekick (Employee)
  • 20 replies
  • March 23, 2021

Hi Mathias,

It does the job with the Print Dialog screen. In my case the printing should happen without the print dialog.
How to trigger the same thing in that case ?

Regards,
Tharindu


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • 2822 replies
  • March 23, 2021

I don’t know that, sorry.

 


ChanakaAmarasekara
Hero (Employee)
Forum|alt.badge.img+15

As Mathias said you can use a Report Rule called’ Check in to Docman” to check in the generated PDF report to document management. It’s doesn’t matter if you print it through the Print Dialog or not. You need to print to a Logical Printer. If the print job is successfully completed then the rule is triggered and checked in to docman. There are lots of places in the IFS Application where printing is done directly without showing the Print Dialog.


ChanakaAmarasekara
Hero (Employee)
Forum|alt.badge.img+15

In the “Inventory Part Barcodes Analysis” page select a row and select “Print Barcode Label” button at the top or from the menu. You will be asked to print without preview or not. If you select “Yes” to print without preview, it will directly put a print job. If you follow that you can find the code on how to do so, and with the Report Rule, you can checkin to docman.


dsj
Superhero (Partner)
Forum|alt.badge.img+22
  • Superhero (Partner)
  • 832 replies
  • March 30, 2021

Hi @tharindukshan ,

 

Following thread has some good examples on how to create a print job and print.

 Batch print Work Instructions for Shop Orders, IFS9 | IFS Community

 

Check-in the pdf to docman:

If the report rules does not work in favor, you can create an event action in PDF_REPORT_CREATED and do the coding. 

Attached script is something I prepared for a similar requirement and it has the code you’ll need to create a docman object, check-in report pdf and create a doc reference in Inventory part. Hope it will be useful. It’s prepared for APPS10 but most probably will work in APPS9 without a complain. Not sure about cloud version.

 

Cheers!

Damith


tharindukshan
Sidekick (Employee)
Forum|alt.badge.img+7
  • Author
  • Sidekick (Employee)
  • 20 replies
  • Answer
  • March 31, 2021

Thank you @Mathias Dahl @ChanakaAmarasekara & @dsj for the support.
With all your help and this post I was able to achieve the result I expected. :)

Regards,

Tharindu


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • 2822 replies
  • March 31, 2021
tharindukshan wrote:

Thank you @Mathias Dahl @ChanakaAmarasekara & @dsj for the support.
With all your help and this post I was able to achieve the result I expected. :)

That’s great to hear! Would it be possible to share some of the details here? For example, if you used a report rule engine, can you share the rules? Others might be very interested in trying out the same thing.

Thanks!

 

 


tharindukshan
Sidekick (Employee)
Forum|alt.badge.img+7
  • Author
  • Sidekick (Employee)
  • 20 replies
  • March 31, 2021

Hi @Mathias Dahl 

Here you go😊

1.  We use the report rule to attach the generated PDF to the Document Management

   

2 . Then We use the server method to print the report to a logical printer as it’ll trigger the                       reporting rule

PROCEDURE C_Silent_Print_Po (
   order_no_ IN VARCHAR2)
IS
   layout_name_        VARCHAR2(2000):= 'PurchaseOrderPrintRep.rdl';
   report_id_          VARCHAR2(2000):= 'PURCHASE_ORDER_PRINT_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):= '';
BEGIN
   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('ORDER_NO_LIST', order_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_);

   Print_Job_Contents_API.New_Instance(instance_attr_);
   Print_Job_API.Print(print_job_id_);
END C_Silent_Print_Po;

 


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • 2822 replies
  • March 31, 2021

Thanks! What is calling that server method? A custom event? A custom menu?

 


tharindukshan
Sidekick (Employee)
Forum|alt.badge.img+7
  • Author
  • Sidekick (Employee)
  • 20 replies
  • April 1, 2021

Hi @Mathias Dahl ,

In my case I’m calling that method through a command in Aurena.


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • 2822 replies
  • April 1, 2021
tharindukshan wrote:

Hi @Mathias Dahl ,

In my case I’m calling that method through a command in Aurena.

Thanks!


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