# Print Report Multiple times with Sequence Number

**URL:** <https://forum.inductiveautomation.com/t/print-report-multiple-times-with-sequence-number/2172>\
**Category:** Archived Topics\
**Created:** [September 3, 2010, 7:26pm UTC](https://forum.inductiveautomation.com/t/print-report-multiple-times-with-sequence-number/2172 "2010-09-03T19:26:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [September 3, 2010, 7:26pm UTC](https://forum.inductiveautomation.com/t/print-report-multiple-times-with-sequence-number/2172/1 "2010-09-03T19:26:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [September 15, 2010, 12:40am UTC](https://forum.inductiveautomation.com/t/print-report-multiple-times-with-sequence-number/2172/2 "2010-09-15T00:40:28Z")

</div>

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)`
