158
Views
14
Comments
Export or download a large dataset of more than 3 million records to an Excel or CSV
Application Type
Reactive
Service Studio Version
11.54.74 (Build 63545)

Is it possible to export or download a large dataset of more than 3 million records to an Excel or CSV file? The maximum number of rows in an Excel sheet is 1,048,576. And If so, Could you provide a sample or any suggestions? I am using OutSystems 11 Reactive Web. 

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @ROMMEL  SIMUNDO ,

1) you are answering your own question, the maximum is 1 mio.

2) A sample of what exactly do you need ?  do you not understand how to export things to excel ?  Do you have trouble coming up with a solution to deal with the size limits ?

3) For anybody to help, maybe it is interesting to also explain why you even want to put 3 mio records in an excel

4) If I would have to guess, I'd say the limit is one of excel as a tool, not the file

Dorine

2024-02-03 23-41-38
ROMMEL SIMUNDO

Thank you for your response. Our client has requested to retrieve all records Transaction, which amount to millions of records due to banking Regulatory. Can you recommend how we can fulfill the client's request compliantly? 

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Oh no, I can absolutely not tell you how to 'fullfill client's request compliantly', 

(and wouldn't even want to, thats a 'paid engineering or consulting job' kind of thing, not a 'help the community with technical questions' kind of thing)


2021-09-06 15-09-53
Dorine Boudry
 
MVP

I just did a quick test of this assumption

4) If I would have to guess, I'd say the limit is one of excel as a tool, not the file

using RecordListToExcel, you can't go above 1048576, so that's not an option


2019-01-07 16-04-16
Siya
 
MVP

If it's just a matter of exporting, why does it have to be in a single file? You can export to separate files. Other options is to create a database clone provided its on premise ( btw you need to know which tables stores what data inside the database per applications). 

2024-02-03 23-41-38
ROMMEL SIMUNDO

I've considered this idea but I'm unsure how to do it. Can you assist me in providing an OML sample for download as a separate file if the total count exceeds one million records? 

2019-01-07 16-04-16
Siya
 
MVP

My suggestion is using advanced query to get the data in CSV format directly from the database  in batches and store this in a Result table ( Id, Start, End, Data(binary) ) and download each of them as individual files. if required you can combine it using a Powershell script.

Sample SQL query you could consider is

SELECT @CSVResult = @CSVResult + CAST(Id AS NVARCHAR) + ',' + FirstName + ',' + LastName + ',' +Email + CHAR(13) + CHAR(10) FROM Employee ORDER BY Id OFFSET @Offset ROWS FETCH NEXT @BatchSize ROWS ONLY;

this will return a single string of all the records ( as per batch size)  from the Offset. You may tweak the values of BatchSize depending on the configuration of your server.

You may create simple page to enter the offset and batchsize or automate it with a timer. Once completed your CSV's will be in the Result table which you can download individually and combine if required.

2019-04-09 00-57-55
carl ruhle

Hi,

export to an csv file and let the client import it.

Like you said, its out of range for an xls file. 

Best regards. 

2025-12-04 09-01-03
Kiet Phan
Champion

In my opinion, you should consult your client and give a better solution.

files doesn't need to be over millions record. We can seperate the files by year, quarter or month. this will also be more effective for error handling when importing or tracing the record.

2024-02-03 23-41-38
ROMMEL SIMUNDO

Indeed, that's correct. We've applied a filter based on the start and end dates, but the volume of transactions within a single month exceeds one million. 

2019-04-09 00-57-55
carl ruhle

I would go on exporting by quarter, its more manageable and easier to track down if any problem arrives. 

2024-02-03 23-41-38
ROMMEL SIMUNDO

Indeed, that's correct. We've applied a filter based on the start and end dates, but the volume of transactions within a single month exceeds one million. 

2024-10-12 12-11-20
Kerollos Adel
Champion

CSV files don't have a strict row limit, but the file size may become unmanageable or slow to process if too large.

2019-04-09 00-57-55
carl ruhle

In that case, break the month in half's, I bet that would be the best solution in this particular case.

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