Skip to main content
Answer

How to Print Number of Copies of Report based on Input number through code

  • September 4, 2024
  • 6 replies
  • 133 views

Forum|alt.badge.img+1

Hello,

How can I print a report a specific number of times based on a dynamic value in Preferences?

I've created a Processing Screen for printing reports, and I need the report to print as many times as the count specified in the Processing Screen.

Can anyone please suggest a solution or provide sample code for this?

Regards. 

Best answer by darylbowman

Have a look here: Launch Multiple Reports with one Exception

6 replies

Forum|alt.badge.img+7
  • Captain II
  • September 4, 2024

@lauraj46 has a blog post that offers up a clever solution for printing multiple copies of a document:

https://www.linkedin.com/pulse/acumatica-tips-tricks-how-print-multiple-product-labels-laura-jaffe/


darylbowman
Captain II
Forum|alt.badge.img+15
var reportParams = new Dictionary<string, string>();
reportParams.Add("BAccount.BAccount", bAccount.AcctCD);
var printSettings = new PrintSettings
{
PrintWithDeviceHub = true,
DefinePrinterManually = true,
PrinterID = printer.PrinterID,
NumberOfCopies = 1 // Change this?
};

PXLongOperation.StartOperation(Base, delegate ()
{
SMPrintJobMaint g = PXGraph.CreateInstance<SMPrintJobMaint>();
g.AddPrintJob("Print job description", printSettings, "ZRLTTX03", reportParams, null);
});

 


Forum|alt.badge.img+1
  • Author
  • Pro I
  • September 4, 2024

hi @darylbowman.
Thanks for the Solution..

If I click the button, I need the report to open in a new tab the specified number of Copies.
Above Code its not showing report.
 


darylbowman
Captain II
Forum|alt.badge.img+15

The code above uses DeviceHub to actual print the report. Are you just asking to open the report a specified number of times?


Forum|alt.badge.img+1
  • Author
  • Pro I
  • September 5, 2024

Yes @darylbowman.

open the report a specified number of times/ copies of same report.


darylbowman
Captain II
Forum|alt.badge.img+15
  • Answer
  • September 5, 2024