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
Comment From: amitmiran137
@villebro could you think of a possible solution for this one ?
Comment From: noobyogi0010
Hi @amitmiran137 ! I would like to work on this issue if nobody has already taken it up. Thanks.
Comment From: nijcap01
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.
Comment From: geido
Hello @noobyogi0010 that would be great! Let me know if you are still interested in working on this issue
Comment From: hosswald
@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.).
Comment From: ankuraga2022
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 .
Comment From: ajaysharma202
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?
Comment From: nijcap01
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
Comment From: Narendra678
I am also facing saME ISSUE
Comment From: huimingz
same issue
Comment From: vicmion
I am also having the same issue.
Comment From: LahmerIlyas
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.
Comment From: geido
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!
Comment From: LahmerIlyas
@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
Comment From: Narendra678
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: @.***>
Comment From: LahmerIlyas
@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
Comment From: LahmerIlyas
@geido could you help me getting the PR reviewed.
Comment From: MengXinAlex
@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.
Comment From: mdeshmu
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 ?
Comment From: LahmerIlyas
@mdeshmu with this PR, when server side pagination is enabled, export to csv will only download the selected page.
Comment From: mdeshmu
@LahmerIlyas How will it behave when i choose "All" entries.
Comment From: mdeshmu
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.
Comment From: LahmerIlyas
@mdeshmu I tried changing the page size to 50 and it downloaded a 50 rows csv file
Comment From: mdeshmu
@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?
Comment From: LahmerIlyas
@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).
Comment From: mdeshmu
@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.
Comment From: nijcap01
Any update on this issue, is above PR included in any version?
Comment From: mike-fischer1
Hi, im having this issue too.
Comment From: geido
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.
Comment From: gstamatakiswxm
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.
Comment From: heichong
This is still an issue for me on 4.0.1 ...
Comment From: rusackas
Thanks for testing... we'll reopen this.
Comment From: vineetdpnd
Is this issue going to be resolved in the upcoming release 4.1.0 ?
Comment From: ghost
@vineetdpnd issue is not resolved in 4.1.1, any updated if in future it will get resolved?
Comment From: RafaelQ31
Happening here too, it's a big issue as we need server side pagination and the customer wants to download all the pages in one go.
Comment From: paulobitar
Same problema. It works if you desable server side pagination but this has a high cost !
Comment From: rusackas
I'm actually finding that when you enable the frontend limit, the server pagination doesn't seem to be working as expected at all. CC @sadpandajoe to see if he has any input / test coverage / context around this that I might not be aware of.
Comment From: sadpandajoe
Nope, nothing that I can think of. Probably need someone to look at this since it sounds like it might only happen if you have server side pagination enabled.
Comment From: paulobitar
I'm actually finding that when you enable the frontend limit, the server pagination doesn't seem to be working as expected at all. CC @sadpandajoe to see if he has any input / test coverage / context around this that I might not be aware of.
I hope you can fix this bug soon, as it is currently a frequent complaint from users and something that has been happening for a long time.
Comment From: rad-pat
I think this bug probably was fixed at one point, it seems now though that the props.ownState
here is no longer returning anything
Comment From: rad-pat
@kgabryje, you did some performance improvements in https://github.com/apache/superset/pull/31241 that seem to touch this last, can you perhaps advise where to pick up the ownState
now? Also other members like isCached
also seems to be gone.