superset
superset copied to clipboard
While exporting CSV , only the entries on first page are getting downloaded even when user is on other pages
When multiple pages are present in a report and user clicks on export CSV , only the data from first page is getting exported in CSV even when any other page is selected.
How to reproduce the bug
- Open any report
- Navigate to any other page using pagination
- Click on export CSV
Expected results- Csv file with entries of current page should get downloaded
Actual results- CSV file with entries of first page getting downloaded
Screenshots

Environment
- browser :Chrome
- superset version:
1.3.1
@villebro could you think of a possible solution for this one ?
Hi @amitmiran137 ! I would like to work on this issue if nobody has already taken it up. Thanks.
Any update on which version can we expect this, also in the above we are using sql templating in datasets.
Hi @amitmiran137 ! I would like to work on this issue if nobody has already taken it up. Thanks.
Hello @noobyogi0010 that would be great! Let me know if you are still interested in working on this issue
@noobyogi0010 @geido Our customer also has issues with the combination of server pagination & csv export. The behaviour is different from exporting from a chart without server pagination.
In a "normal" chart, all pages would be downloaded (e.g. 10 pages a 10 entries = 100 row csv). In a "server paged" chart, the "export CSV" function will
- download the first page only
- ignore changes to "show n entries" (always use the default "server page length")
I would suggest not necessarily going @pratikgera123's proposed way (download the current instead of the first page) but instead harmonizing "server paged" CSV export with normal CSV export, e.g. they should behave the same. The user of a dashboard does not necessarily even know what server paging is and whether it's used, so they expect csv to behave the same either way. We had to suggest to our users to go via "view chart in explore", disable server pagination, and download from there. Not the best user experience, especially given that we have quite some users.
Ideally, the CSV export option should offer a pop-up where such things can be selected before downloading ("download all pages" vs. "download current page", override for limit, etc.).
While downloading the CSV file irrespective of pagination i.e. 10/20/50 items or "All" items in the list, the downloaded file consists first 10/20 records as they were set for pagination for display. Validated on multiple reports and different datasets.
Expected - "Export CSV" option should be extracting records displayed on the view with respect to no. of records set to display on single page
"Export full CSV" option should extract all records.
Actual - Fixed number of records are extracted from both the options .
When multiple pages are present in a report and user clicks on export CSV , only the data from first page is getting exported in CSV even when any other page is selected.
How to reproduce the bug
- Open any report
- Navigate to any other page using pagination
- Click on export CSV
Expected results- Csv file with entries of current page should get downloaded
Actual results- CSV file with entries of first page getting downloaded
Screenshots
Environment
- browser :Chrome
- superset version:
1.3.1
I am also getting the same issue. Can anyone suggest if we can expect this fix in near future?
Hi Team,
Any update on this item, our client is following us regularly on this, Please let us which version we are targeting this so that we can respond accordingly.
Thanks
I am also facing saME ISSUE
same issue
I am also having the same issue.
Hi @geido I would like to work on this issue if no one else is working on it. I was able to reproduce it locally and I think that the issue is that related to the attribute row_offset is always sent as 0 in the post request when exporting as csv.
If no one is working on this, I can try resolving it.
Hi @geido I would like to work on this issue if no one else is working on it. I was able to reproduce it locally and I think that the issue is that related to the attribute row_offset is always sent as 0 in the post request when exporting as csv.
If no one is working on this, I can try resolving it.
Hi @LahmerIlyas sure thing. Contributions are more than welcome. Let me know if you need any help with this!
@geido I was able to resolve the issue. Apparetly the ownstate prop was not being passed to ConnectedExploreChartHeader and the useExploreAdditionalActionsMenu() hook. I will create a PR for that
Hi Team,
Thanks for reply.
What do you mean by ownstate? and useExploreAdditionalActionsMenu() hook
Is it resolved? may i know what changes i have make, please let me know.
Regards, Naren
From: Ilyas @.> Sent: 24 May 2022 23:55 To: apache/superset @.> Cc: Narendra Reddy @.>; Comment @.> Subject: Re: [apache/superset] While exporting CSV , only the entries on first page are getting downloaded even when user is on other pages (Issue #17861)
@geidohttps://github.com/geido I was able to resolve the issue. Apparetly the ownstate prop was not being passed to ConnectedExploreChartHeader and the useExploreAdditionalActionsMenu() hook. I will create a PR for that
— Reply to this email directly, view it on GitHubhttps://github.com/apache/superset/issues/17861#issuecomment-1136293985, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVFA24WVCUIPPOR5WUJOI2LVLUNJXANCNFSM5KUWD5CQ. You are receiving this because you commented.Message ID: @.***>
@Narendra678 it was a bug in the code, and I resolved it and submitted a pull request(https://github.com/apache/superset/pull/20178/files) for it, but no one reviewed it yet.
Here is a video of how it looks:
https://user-images.githubusercontent.com/31275446/170707907-46b291d8-8a28-47e5-af25-061529ab40d2.mp4
@geido could you help me getting the PR reviewed.
@Narendra678 it was a bug in the code, and I resolved it and submitted a pull request(https://github.com/apache/superset/pull/20178/files) for it, but no one reviewed it yet.
Here is a video of how it looks:
output.mp4
Hi LahmerIlyas, thanks for your help! it is solved my issue.
In my case, with server pagination enabled, both option behave same way and download only first page. Is this PR going to make "Full CSV Export" option download all pages ?
@mdeshmu with this PR, when server side pagination is enabled, export to csv will only download the selected page.
@LahmerIlyas How will it behave when i choose "All" entries.

In Table Chart's configuration, I have server page length set to 10. When in dashboard I change the page size to 50 yet it still downloads 10 rows. My expectation is it would download 50 rows.
@mdeshmu I tried changing the page size to 50 and it downloaded a 50 rows csv file

@LahmerIlyas Please confirm, you are testing with "Export CSV"? How does "Export CSV" behave when you choose "All" option? How does ""Export Full CSV" behave after your changes?
@mdeshmu Yes, I confirm that I'm using "Export CSV". When you choose "All" option, it will download all rows (Keep in mind that this might freez your browser if you have lot of rows). For the "Export Full CSV", this PR doesn't implement this feature (I'm okay with contributing such feature if the maintainers are okay with it).
@LahmerIlyas "Export Full CSV" feature is already there controlled via flag ALLOW_FULL_CSV_EXPORT but it doesn't work as expected. My understanding is, it should export full csv irrespective of what page you are on in dashboard or chart's server page length value.
Any update on this issue, is above PR included in any version?
Hi, im having this issue too.
Hello. As this issue has been stale for a while now, I'll be closing it. If anyone experiences this issue in a recent version of Superset, please feel free to submit a new one.
This is still an issue for me on 3.1.0, when pagination is enabled only the first page is downloaded even if the 'ALLOW_FULL_CSV_EXPORT' flag has been enables.