# Report-Scripting data source

**URL:** <https://forum.inductiveautomation.com/t/report-scripting-data-source/16325>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [December 14, 2017, 5:13pm UTC](https://forum.inductiveautomation.com/t/report-scripting-data-source/16325 "2017-12-14T17:13:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edwingoth](https://avatars.discourse-cdn.com/v4/letter/e/4af34b/32.png) [@edwingoth](https://forum.inductiveautomation.com/u/edwingoth)\
**Post date:** [December 14, 2017, 5:13pm UTC](https://forum.inductiveautomation.com/t/report-scripting-data-source/16325/1 "2017-12-14T17:13:03Z")

</div>

Hello, I am working on the scripting data source of the reports module. I have a search from my database where I count the amount of alarms generated in a lapse of time, to have the result I need to perform a comparison operation in the scripting where if the value is\> = or \<= to another value entered Print me a text The problem arises that the comparison is not made correctly, when putting static values ​​results but if I work with the search this process does not work. I enclose the scripting for more information. I hope you can help me.

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/90f4446e11b8d21ec80303487ece00ac9c231184.PNG)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 14, 2017, 5:33pm UTC](https://forum.inductiveautomation.com/t/report-scripting-data-source/16325/2 "2017-12-14T17:33:06Z")

</div>

In your screenshot, ‘Nro\_voltajes\_bajos’ is a query, so getCoreResults() is the correct method to use. But that gives you a dataset, not a number you can compare. If that dataset has a single value, add .getValueAt(0,0) to .getCoreResults(). Otherwise, you’ll have to loop through the rows of the dataset.
