Is there a way I could print the report viewer multiple times while incrementing a number on the report?
Say I have a input of the number of copies e.g. 10 and the number I want to start counting from e.g. 1000 . then when the print button is clicked it will print the same report 10 times with the number 1000 to 1009.
i have tried changing a string property on the report by incrementing it with a loop and calling report.print(None, 0), but it just prints the same number on all the reports.
Thanks for the help.
Unfortunately, it is not that easy right now to accomplish this. Whenever a property changes on a report the fires the report generation in a separate thread. Right now there is no way to know when that thread is completed. So you just have to wait a few seconds hoping that it is done. I have put in a ticket to let the user know that the report is generated but for now you can use the following script:def doAsynch(event=event):
from java.lang import Thread
import system
for val in range(1000,1002):
report = event.source.parent.getComponent('Report Viewer')
def doLater(report=report, val=val):
report.Counter = val
system.util.invokeLater(doLater)
Thread.sleep(2000)
def doLater(report=report):
report.print(None, 0)
system.util.invokeLater(doLater)
system.util.invokeAsynchronous(doAsynch)