Printing tables

james 14MAR06 - Is there any way to print a table in its entirety? For example, if a table has a scroll bar, can I cause even the part that isn’t showing to print too?

One other thing. What if I just want to save it as an HTML web page instead? Is there a way to do this too?

Thank you.

CarlG 15MAR06 - James,

You may have been trying to print the table using the


built-in Jython function. This function prints the screen like a screenshot, hence, you will only get the visible portion of the table.

You should look at the Table component’s documentation where you will find details of a function called print() on the table itself. This function will print the table on multiple pages, if necessary. For example, if you put this script in a button next to a table called “MyTable”, it would prompt the user to print the table:

table = event.source.parent.getComponent(“MyTable”)

The table also has a function called exportHTML(), which exports the table’s data as an HTML page. The table’s exportHTML() function formats the HTML page very closely to how the table itself is formatted, including colors and column sorting, which makes it a better choice than the fpmi.db.exportHTML() built-in library function.

Carl Gould
Software Engineer
Inductive Automation