Get the total records found from report control query


Adrian Brookbank

Hi,

What variable contains the total records found from report control query?

Thanks,


DecSoft

Hello Adrian,

Probably we must use here a bit of Javascript code, in order to count the visible Report's rows, for example, the below one:

The below do the same using jQuery, since it's available too:



Adrian Brookbank
Thanks for this David, I’m needing to run query and obtain the row count straight after, however I’m finding that until the table is redrawn and shown - the variable isn’t available.. Any ideas on how I can get around this..? Cheers,

DecSoft

Hello Adrian,

I understand what you need, however, certainly the Success event of the Report control is fired when the Data has been loaded, but don't work when we query the Report's. So, trying to find a possible workarond, maybe what we need to do is to query the Data variable by hand, in the client side or in the server side, then we can know the records of the Data variable before set it in the Report's control.



Amin Mousavi
Hi David, I have a report control that is displaying the results that an API returns. I would like to write an SQL query on the results. I know how to read the JSON objects and manipulate them in a loop at the success event of HTTPCLIENT, but I was looking for using some SQL at the client side if possible. My queries on the server side are becoming more and more complicated and pushing some of the processing pressure to the client side would be nice.

DecSoft

Hello Amin,

I am not sure if can understand. First of all, probably it's better than the server take care about the data processing, and feed the app in the right way. On the other hand, in what context do you want to use SQL queries in the client side? That is, are you talking about to use something like the IndexedDB technology?



Amin Mousavi
Hi David, I know, my query at the server side already includes 6 sub-queries and joins and it worries me that when we have a large amount of data the complexity of the query may causes some delays in responding to the client. So in this instance lets say in a sample similar to Adrian's I have some data that I have assigned directly to the Report control from HTTPCLIENT. Before I display them I would like to run a SUM/Group by on the data and display the results at the same table or even elsewhere. It would help a lot if by any means we can run a SQL query on the received data from the API.

DecSoft

Hello Amin,

But, unfortuantelly, something like that is not possible. The Report control nor the Data variable (which is only an array) support something like SQL, Amin. In my honest opinion, I think you no need to worry about the server SQL complexity... except if you find some unexpected result, in which you must try to optimize the queries. Personally, I am developing certain app which have amazing SQL queries (to me, since I am not an expert in SQL) in the server side, and everything works fine.



Amin Mousavi
Hi David, Yeah, that is what I thought. SQL and data analysis is actually my primary profession. I work with health data and they grow so much so fast and their analysis is never straight forward so speed of the queries is always a worry for me as I have seen how slow they may become and how much memory they may consume!

DecSoft

Hello Amin,

Honestly I think than the server is the best to do this things. But, anyway, we can't use SQL in Javascript "as is". We can use the "IndexedDB" database, which offer SQL queries, but, outside that context, we can't use SQL to deal with data. But even if possible, I insist that the server can be better for this. Maybe the "IndexedDB" can be an option, that is, you can feed the database, and then query it in order to conform a Report's Data variable. But I am not sure that this is a good idea... if the server can do that.



Amin Mousavi
Thanks a lot for your help David. Much appreciated, I will take your recommendation and stick to processing data only at server side. I am actually trying another approach to use some variables within my queries on the server to hopefully reduce two joins, if that works it is all sorted for this part ;) Thanks again.

Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.