Report-Scripting data source

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.

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.

2 Likes