Print Table ontents

Hello All,

I am using table component to display the result of SQL Select query. I am getting all the values in Table on Ignition screen when I run application. What I am not able to do is that I am using table.print() funtion to get the hard copy of this table contents.

Below is my code.

[code]
import system
import app

window = system.gui.getWindow(“Current Details”)

table = window.rootContainer.getComponent(“Table”) # Get a reference to the table
#table = event.source.parent.getComponent(“Table”) # Get a reference to the table
#system.dataset.exportExcel("/home/pacrim_xterm3/Documents/data.xls", 1 , table.data)
table.print()[/code]

This code pops up the Printer Setting window for Printer selection and other Page Setup options.

When I click on Print button in this dialogue box, I just get EMPTY table printed on a paper.

I have attached screen shot of my table contents and my print operation output file.

Can somebody know how to do this?

Thanks
Ashish

Sorry for the late response, have you been able to get this to work?

I was able to print the contents of the table with this script

table = event.source.parent.getComponent('Table') table.print()

It looks like you are using the same code. Just a note, I didn’t import anything. If you have not gotten this to work I would consider updating your printer driver. Since you are seeing the printer dialogue box that tells me Ignition is doing what it is supposed to do.