420
Views
5
Comments
Solved
[OutSystems Data Grid] How to handle large amount of data with out server side pagination
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

Hi

I have one entity and in that entity i have near about 5 million record and we have to export data in csv and excel file.so for that reason we are using advance sql to fetch the data and displaying the data in datagrid reactive and user is able to export all data in single click but in screen we have datagrid reactive default pagination but we are facing some time "connection time out issue".i saw that we can resolve with help of server side pagination but if i implement server side pagination then some functionality will not work like excel/csv import.

is there any other way to resolve this issue?

2020-08-05 09-00-16
Gabriel Lundgren
Solution

Hello Arkyadeep Bharadwaj,

On our latest release (2.6.1), we added a new client action called Filter/SetColumnFilterOptions that sets the list of options that will appear on the "Filter By Value" of a given column. This way you can populate the column's filter options with all your records. In our sample, we are using it in the Product Category column.

Regarding pagination, our default block only works for client-side pagination, that's why you need to use the Pagination widget or another block. In the same sample, we are using this approach. You can download the sample and see how we achieved the result.


For exporting CSV or Excel, that's a known limitation and as of now, there is not much we can do.


Please let me know if this helps you.


Gabriel Lundgren

2025-02-04 11-46-43
Waseema Shaikh
Staff

Hi Buddy,

i understand you have multiple issues:

1. fetching data and displaying in data grid. that I recommend to use server side pagination only, it will be having major impact on your application performance if you fetch the complete record set in one shot. try extending your sql query to fetch pagination data sample: 


DECLARE @PageNumber AS INT

            DECLARE @RowsOfPage AS INT

        DECLARE @MaxTablePage  AS FLOAT 

        SET @PageNumber=1

        SET @RowsOfPage=4

        SELECT @MaxTablePage = COUNT(*) FROM SampleFruits

        SET @MaxTablePage = CEILING(@MaxTablePage/@RowsOfPage)

        WHILE @MaxTablePage >= @PageNumber

        BEGIN

         SELECT FruitName,Price FROM SampleFruits

        ORDER BY Price 

        OFFSET (@PageNumber-1)*@RowsOfPage ROWS

        FETCH NEXT @RowsOfPage ROWS ONLY

        SET @PageNumber = @PageNumber + 1

        END


2. download data in xls/ csv: have another async server call which will fetch entire record set to export data to excel.


hope this helps.

2023-06-14 08-52-52
Arkyadeep Bharadwaj

if we use server side action then datagrid reactive inbuilt some of functionality will not work but client wants that all functionality which we have.

2025-02-04 11-46-43
Waseema Shaikh
Staff
2023-06-14 08-52-52
Arkyadeep Bharadwaj

in the documentation it is saying below thing

Limitations

The server-side pagination has some limitations:
- Filter By Value: it’s only possible to filter values by condition. When the user clicks on the filter icon on column headers, only the “Filter By Condition” option will be visible.
- Pagination: not possible to use the grid block default pagination. It’s necessary to drag-and-drop the Pagination widget or use a custom pagination block.
- Export to CSV or Excel: this context menu option will only export the current page data.


have u used this component in any application?if i am using 50 rows per screen then i will use aggregate.


2020-08-05 09-00-16
Gabriel Lundgren
Solution

Hello Arkyadeep Bharadwaj,

On our latest release (2.6.1), we added a new client action called Filter/SetColumnFilterOptions that sets the list of options that will appear on the "Filter By Value" of a given column. This way you can populate the column's filter options with all your records. In our sample, we are using it in the Product Category column.

Regarding pagination, our default block only works for client-side pagination, that's why you need to use the Pagination widget or another block. In the same sample, we are using this approach. You can download the sample and see how we achieved the result.


For exporting CSV or Excel, that's a known limitation and as of now, there is not much we can do.


Please let me know if this helps you.


Gabriel Lundgren

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.