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

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?

https://docs.inductiveautomation.com/display/DOC81/Vision+-+Table

Scroll down to where it talks about the print function.