# Print button and set margins without using system.print()

**URL:** <https://forum.inductiveautomation.com/t/print-button-and-set-margins-without-using-system-print/59425>\
**Category:** Ignition\
**Tags:** scripting, vision\
**Created:** [May 10, 2022, 7:18pm UTC](https://forum.inductiveautomation.com/t/print-button-and-set-margins-without-using-system-print/59425 "2022-05-10T19:18:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay\_Whorton](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@Jay\_Whorton](https://forum.inductiveautomation.com/u/Jay_Whorton)\
**Post date:** [May 10, 2022, 7:18pm UTC](https://forum.inductiveautomation.com/t/print-button-and-set-margins-without-using-system-print/59425/1 "2022-05-10T19:18:35Z")

</div>

I need to print a table and all of its contents. Only way I can get it to do this is by using the following code:

# Define tables.

BaleBrkrTable = event.source.parent.getComponent('BaleBrkr Table').data  
SupervisorTable = event.source.parent.getComponent('Supervisor Table').data  
PlanningTable = event.source.parent.getComponent('Planning Table').data  
workOrder = event.source.parent.getComponent('WO Number').getComponent('Work Order Number Entry').text

# If the selected tab strip has Bale breaker selected, print that table.

if event.source.parent.getComponent('Tab Strip').selectedTab == 'Bale Breaker':

```
event.source.parent.getComponent('BaleBrkr Table').print(headerFormat = 'Work Order: ' + workOrder)

```

# Supervisor table

elif event.source.parent.getComponent('Tab Strip').selectedTab == 'Supervisor':

```
event.source.parent.getComponent('Supervisor Table').print(headerFormat = 'Work Order: ' + workOrder)

```

# Planning table.

elif event.source.parent.getComponent('Tab Strip').selectedTab == 'Planning':

```
event.source.parent.getComponent('Planning Table').print(headerFormat = 'Work Order: ' + workOrder)

```

It prints the table just fine. However, I need to set the margins so that I can utilize more of my page and display more of the data on less paper.

I've tried to use the system.print() but that seems to want to print a snapshot of the window rather than the data table as a whole.

Any ideas?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 10, 2022, 11:53pm UTC](https://forum.inductiveautomation.com/t/print-button-and-set-margins-without-using-system-print/59425/2 "2022-05-10T23:53:21Z")

</div>

[https://docs.inductiveautomation.com/display/DOC81/Vision+-+Table](https://docs.inductiveautomation.com/display/DOC81/Vision+-+Table)

Scroll down to where it talks about the print function.
