Skip to main content
Solved

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

  • 4 September 2024
  • 6 replies
  • 78 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

View original
Did this topic help you find an answer to your question?

6 replies

Forum|alt.badge.img+5
  • Captain II
  • 499 replies
  • 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+13
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
  • 59 replies
  • 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+13

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
  • 59 replies
  • September 5, 2024

Yes @darylbowman.

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


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

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