Accessing Print Dialog Box with a given value of print copies and get the default printer

I have a simple code below, I have set the printer name and set the print dialog to False. My question is how i can access or code the number of copies with a given value by the user

	report = event.source.parent.getComponent('Report Viewer')
	report.print("EPSON TM-T82II Receipt5",0)

You can’t, directly. Something like this may work:

from org.apache.commons.lang3.reflect import FieldUtils

def setCopies(component, copies):
	rmViewer = FieldUtils.readField(component, "reportView", True)
	rmViewer.copies = copies

Which you would use something like this:

setCopies(event.source.parent.getComponent("Report Viewer"), 3)

It seems the code doesn’t work.

Well, if you can provide any detail about what ‘doesn’t work’ means - is an error thrown? Where are you applying the code? I might be able to help.

It does not throw any errors,
Maybe constructing/applying code
I want to elaborate what the program should do

i have a report viewer(barcode) and a default printer, the printer should printer the report viewer for a example 4 times.depends othe the input quantity