# Printing alert reports

**URL:** <https://forum.inductiveautomation.com/t/printing-alert-reports/5062>\
**Category:** Ignition\
**Created:** [August 27, 2012, 6:13pm UTC](https://forum.inductiveautomation.com/t/printing-alert-reports/5062 "2012-08-27T18:13:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![amr123](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@amr123](https://forum.inductiveautomation.com/u/amr123)\
**Post date:** [August 27, 2012, 6:13pm UTC](https://forum.inductiveautomation.com/t/printing-alert-reports/5062/1 "2012-08-27T18:13:36Z")

</div>

What is the EZest way to print/export alert reports from history database?

I have read about setting up DataSets and I can see the data that I want on the Gateway server webpage when I go to “Alert Console” and filter by severity etc.

I have the PDF report module but I don’t think I need it if I could just print the filtered reports that I want.

---

<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 27, 2012, 6:21pm UTC](https://forum.inductiveautomation.com/t/printing-alert-reports/5062/2 "2012-08-27T18:21:01Z")

</div>

The easiest way is to write a SQL query that brings back the alerts that you want based on your filters. You can bring the information back on a table component and print/export the data. What information do you want exactly?

---

<div class="post-metadata">

**Author:** ![amr123](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@amr123](https://forum.inductiveautomation.com/u/amr123)\
**Post date:** [August 27, 2012, 6:39pm UTC](https://forum.inductiveautomation.com/t/printing-alert-reports/5062/3 "2012-08-27T18:39:37Z")

</div>

I need three filters; last 24 hours from 12 to 12 with Low severity, Low Med severity, and Med to High severity.

Auto print or export to PDF would be nice too.

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [August 27, 2012, 11:40pm UTC](https://forum.inductiveautomation.com/t/printing-alert-reports/5062/4 "2012-08-27T23:40:57Z")

</div>

That should be very easy to do with the built-in functions in Ignition. Particularly: [system.alert.queryAlertHistory()](http://www.inductiveautomation.com/support/usermanuals/ignition/system_alert_queryalerthistory.htm)

---

<div class="post-metadata">

**Author:** ![amr123](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@amr123](https://forum.inductiveautomation.com/u/amr123)\
**Post date:** [August 28, 2012, 12:32pm UTC](https://forum.inductiveautomation.com/t/printing-alert-reports/5062/5 "2012-08-28T12:32:13Z")

</div>

I see the example but remember, I come with a RSView background and I’m not a programmer nor am I experienced in Ignition. So please elaborate.

Where do I put this code, how do I show it in a window and how do I print the result.

Lets just say, “Make it Barney style for me!”. LOL

---

<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 28, 2012, 6:52pm UTC](https://forum.inductiveautomation.com/t/printing-alert-reports/5062/6 "2012-08-28T18:52:59Z")

</div>

It really depends on whether or not you want it to automatically happen or view the information on a window. If you want it to be automatic you can put a script in the “Event Scripts - Gateway.” Otherwise, you can just simply make a window in your project.

On the window you can add a table component. You can bind the data property of the table to a function binding where you can use the alert history function. That binding will return any alerts with your filters. You can put a button on the window to save the data to CSV or print it.

The system.alert.queryAlertHistory function that Robert mentioned is used in scripting only. That is what you would use in your automatic script.

I would suggest you contact your account rep here and setup a web demonstration. We can tailor it to specific functions you want accomplished and show you how to do it. You can also call our tech support at (800) 266-7798 and press 2. They can also walk you through setting this up.
