# Print Chart at 6am

**URL:** <https://forum.inductiveautomation.com/t/print-chart-at-6am/323>\
**Category:** Archived Topics\
**Created:** [August 6, 2007, 7:46pm UTC](https://forum.inductiveautomation.com/t/print-chart-at-6am/323 "2007-08-06T19:46:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hirzel](https://avatars.discourse-cdn.com/v4/letter/h/3da27b/32.png) [@hirzel](https://forum.inductiveautomation.com/u/hirzel)\
**Post date:** [August 6, 2007, 7:46pm UTC](https://forum.inductiveautomation.com/t/print-chart-at-6am/323/1 "2007-08-06T19:46:53Z")

</div>

We now have several Easy Charts working, When you call up the page, it populates with the current days temperature, starting at 6am.

Is there a way to automatically print these charts on a daily basis, i.e. At 6am, the chart would print with data from 6am yesterday until now (6am today).

John

---

<div class="post-metadata">

**Author:** ![nathan](https://avatars.discourse-cdn.com/v4/letter/n/c5a1d2/32.png) [@nathan](https://forum.inductiveautomation.com/u/nathan)\
**Post date:** [August 7, 2007, 12:41am UTC](https://forum.inductiveautomation.com/t/print-chart-at-6am/323/2 "2007-08-07T00:41:43Z")

</div>

FactoryPMI doesn’t have a central Jython engine that always runs so you’ll have to have a running client. You also need to deal with cases where multiple clients are open or where certain clients don’t have the printer configured.

-First use something simple such as a button press to print the graph. You can either use [fpmi.print.createPrintJob()](http://www.inductiveautomation.com/products/factorypmi/usermanual/source/technical/jython/modulesprinting.htm) or the easyChart’s [print()](http://www.inductiveautomation.com/products/factorypmi/usermanual/source/technical/components/charts_Easy_Chart.htm#print) function.

-Create a global timer script that runs periodically to determine if it’s time to print the graph. I would use a last\_printed datetime in the database to ensure that you only print once a day [this post](http://www.inductiveautomation.com/forum/viewtopic.php?t=2658) gives an example db timestamp timeout query. I would also recommend maintaining a list of computers in a database table (either computernames or IP addresses) that have the printer configured. You can compare the clients info against the database values with the [fpmi.net functions](http://www.inductiveautomation.com/products/factorypmi/usermanual/source/technical/jython/modulesnet.htm).

I’m not sure how to specify the printer (or use the default printer) and print without prompting the user. Typically, calling the print() function opens a print window. I’ll get back to you on this.

---

<div class="post-metadata">

**Author:** ![hirzel](https://avatars.discourse-cdn.com/v4/letter/h/3da27b/32.png) [@hirzel](https://forum.inductiveautomation.com/u/hirzel)\
**Post date:** [August 7, 2007, 1:53pm UTC](https://forum.inductiveautomation.com/t/print-chart-at-6am/323/3 "2007-08-07T13:53:14Z")

</div>

OK,

This gives me good ideas on how to do this.

I’ll keep you posted as to how this works out.

Thanks

john

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [August 7, 2007, 4:51pm UTC](https://forum.inductiveautomation.com/t/print-chart-at-6am/323/4 "2007-08-07T16:51:10Z")

</div>

If you want to print to the default printer without displaying the print dialog window do the following:

`job = fpmi.print.createPrintJob(Component)
job.setMargins(0.5)
job.zoomFactor = 0.75
job.showPageFormat = 0
job.showPrintDialog = 0
job.print()`

Hope this helps.

---

<div class="post-metadata">

**Author:** ![Step7](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Step7](https://forum.inductiveautomation.com/u/Step7)\
**Post date:** [June 22, 2008, 8:01pm UTC](https://forum.inductiveautomation.com/t/print-chart-at-6am/323/5 "2008-06-22T20:01:25Z")

</div>

I just set up a printer for the customer, and am using print() from the table component. Is there a parameter available to define the orientation? Or, is there a way to save the print parameters in the dialog box?

I see there is an orientation setting for createPrint Job, but I don’t know if I can use that in conjunction with the table.print().

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [June 23, 2008, 6:23pm UTC](https://forum.inductiveautomation.com/t/print-chart-at-6am/323/6 "2008-06-23T18:23:50Z")

</div>

No there isn’t an orientation option with the table’s built-in print() function. I’ll add this as a feature request. You could get more control over the printing of a table if you made the table a report using the Reporting Plugin, or you might be able to set the default (in Windows) on the printer to landscape (this would create a per-client setup issue though…)

---

<div class="post-metadata">

**Author:** ![Step7](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Step7](https://forum.inductiveautomation.com/u/Step7)\
**Post date:** [June 23, 2008, 6:31pm UTC](https://forum.inductiveautomation.com/t/print-chart-at-6am/323/7 "2008-06-23T18:31:42Z")

</div>

I tried setting the printers properties within windows, but the pop-up window properties always overrode them.

That said, the pop-up dialog now is storing the landscape orientation. I rebooted the client previously for another reason, and now I don’t have to change it anymore. Is it possible that whatever loads the defaults for the pop-up only reads them only on start-up?

Anyway, I’ll have the customer keep an eye on it, and see if there is a pattern. Thanks.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [June 23, 2008, 6:44pm UTC](https://forum.inductiveautomation.com/t/print-chart-at-6am/323/8 "2008-06-23T18:44:46Z")

</div>

> [@Step7](#):
>
> Is it possible that whatever loads the defaults for the pop-up only reads them only on start-up?

Yeah, that is possible. Keep an eye on it...
