Topic: Determine Grid Total Filtered Record With Pagination

Good Day,

Can anyone enlighten me on my problem? I need a function or property of Grid to determine the Total Record Found(Filtered, not the total record in the table). I'm working with Offset/Pagination Grid

e.g.
I have 1 million records paginated by 100's

Then, for example: filtering the grid with bunch of filters, I want to know the total filtered record (say for example, the filtered records are 500,110). Is there any simple way to do or get the 500,110 without executing query? My filters consist of at least 50 filters., It is so hard to generate query from it.

Thank you in advance.

Re: Determine Grid Total Filtered Record With Pagination

Hello.


Unfrotunately there is no another way except do query like SELECT COUNT(*) FROM tablegrid WHERE ....

Dmitry.

Re: Determine Grid Total Filtered Record With Pagination

Brian,
How are you filtering? Are you using the SEARCH action or SQL QUERY? If you are using the SEARCH action for filtering then you could try the attached example. It is a little awkward and I have no idea how it will impact the speed of your application with the amount of records you have. But basically you create a hidden tablegrid and Search button with the same search as the visible one. Place the count in the footer of the hidden tablegrid. Then upon execution of the visible search you click (thru script) the hidden search button. Then populate the count label with the footer count in the hidden tablegrid.


If you are using SQL QUERY for filtering, then, as Dimitry pointed out, you will need to use SQL Query to count the filtered records. You should be able to use the same query WHERE clause as the SQL Query used in loading the tablegrid.

Post's attachments

Attachment icon Pagination with Filter Count.zip 593.6 kb, 42 downloads since 2019-05-15