# Selecting and printing data from a table

**URL:** <https://forum.inductiveautomation.com/t/selecting-and-printing-data-from-a-table/60455>\
**Category:** Ignition\
**Created:** [June 7, 2022, 3:11pm UTC](https://forum.inductiveautomation.com/t/selecting-and-printing-data-from-a-table/60455 "2022-06-07T15:11:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JHON\_FLOREZ](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@JHON\_FLOREZ](https://forum.inductiveautomation.com/u/JHON_FLOREZ)\
**Post date:** [June 7, 2022, 3:11pm UTC](https://forum.inductiveautomation.com/t/selecting-and-printing-data-from-a-table/60455/1 "2022-06-07T15:11:58Z")

</div>

saludos, estoy realizando este proyecto: al momento de que seleccione una o mas celdas, se imprima la información de la misma

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/2/92fc958c7ddfe50952ceaa55e10897aa972e3f42.png)

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [June 7, 2022, 3:43pm UTC](https://forum.inductiveautomation.com/t/selecting-and-printing-data-from-a-table/60455/2 "2022-06-07T15:43:27Z")

</div>

If you have the reporting module, I would create a report that receives it’s data from a parameter. Then with an action performed script on a button you would `executeAndDistribute()` the report passing the selected data in.

```auto
table = event.source.parent.getComponent('Power Table')
rows = table.getSelectedRows()

if rows:
	dataIn = system.dataset.toPyDataSet(table.data)
	headers = list(table.data.getColumnNames())
	dataOut = []
	
	for i,row in enumerate(dataIn):
		if i in rows:
			dataOut.append(row)
	
	printData = system.dataset.toDataSet(headers,dataOut)
	
	# pass printData to report and print using system.report.executeAndDistribute()

```

---

<div class="post-metadata">

**Author:** ![JHON\_FLOREZ](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@JHON\_FLOREZ](https://forum.inductiveautomation.com/u/JHON_FLOREZ)\
**Post date:** [July 14, 2022, 3:28pm UTC](https://forum.inductiveautomation.com/t/selecting-and-printing-data-from-a-table/60455/3 "2022-07-14T15:28:18Z")

</div>

Saludos, después de un largo tiempo eh retomado nuevamente mi proyecto y tengo un problema

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/2/d20bf5c419f94481e2de3079f19555c00b8421ee.png)

esto me aparece al ejecutar el código podrías ayudarme diciéndome mi error
