Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While exporting CSV , only the entries on first page are getting downloaded even when user is on other pages #17861

Closed
pratikgera123 opened this issue Dec 23, 2021 · 30 comments
Labels

Comments

@pratikgera123
Copy link

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

  1. Open any report
  2. Navigate to any other page using pagination
  3. 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

image

Environment

  • browser :Chrome
  • superset version: 1.3.1
@pratikgera123 pratikgera123 added the #bug Bug report label Dec 23, 2021
@amitmiran137
Copy link
Member

@villebro could you think of a possible solution for this one ?

@noobyogi0010
Copy link

Hi @amitmiran137 !
I would like to work on this issue if nobody has already taken it up.
Thanks.

@nijcap01
Copy link

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.

@geido
Copy link
Member

geido commented Jan 24, 2022

Hello @noobyogi0010 that would be great! Let me know if you are still interested in working on this issue

@geido geido added the good first issue Good first issues for new contributors label Jan 24, 2022
@hosswald
Copy link

hosswald commented Jan 24, 2022

@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.).

@geido geido added the need:community-volunteer Requires a community volunteer label Jan 25, 2022
@ankuraga2022
Copy link

ankuraga2022 commented Feb 9, 2022

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 .

Pagination

@ajaysharma202
Copy link

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

  1. Open any report
  2. Navigate to any other page using pagination
  3. 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

image

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?

@geido geido added the preset:cares Preset cares about this issue label Feb 9, 2022
@nijcap01
Copy link

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

@Narendra678
Copy link

I am also facing saME ISSUE

@huimingz
Copy link

same issue

@vicmion
Copy link

vicmion commented May 23, 2022

I am also having the same issue.

@LahmerIlyas
Copy link
Contributor

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.

@geido
Copy link
Member

geido commented May 24, 2022

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!

@LahmerIlyas
Copy link
Contributor

@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

@Narendra678
Copy link

Narendra678 commented May 27, 2022 via email

@LahmerIlyas
Copy link
Contributor

LahmerIlyas commented May 27, 2022

@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

@LahmerIlyas
Copy link
Contributor

@geido could you help me getting the PR reviewed.

@MengXinAlex
Copy link

@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.

LahmerIlyas added a commit to LahmerIlyas/superset that referenced this issue Jun 1, 2022
@mdeshmu
Copy link
Contributor

mdeshmu commented Jun 8, 2022

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 ?

@LahmerIlyas
Copy link
Contributor

@mdeshmu with this PR, when server side pagination is enabled, export to csv will only download the selected page.

@mdeshmu
Copy link
Contributor

mdeshmu commented Jun 8, 2022

@LahmerIlyas How will it behave when i choose "All" entries.
image

@mdeshmu
Copy link
Contributor

mdeshmu commented Jun 8, 2022

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.

@LahmerIlyas
Copy link
Contributor

@mdeshmu I tried changing the page size to 50 and it downloaded a 50 rows csv file
export 50 items

@mdeshmu
Copy link
Contributor

mdeshmu commented Jun 9, 2022

@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?

@LahmerIlyas
Copy link
Contributor

LahmerIlyas commented Jun 9, 2022

@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).

philipher29 pushed a commit to ValtechMobility/superset that referenced this issue Jun 9, 2022
@mdeshmu
Copy link
Contributor

mdeshmu commented Jun 9, 2022

@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.

@nijcap01
Copy link

nijcap01 commented Jul 2, 2022

Any update on this issue, is above PR included in any version?

@mike-fischer1
Copy link

Hi, im having this issue too.

@geido
Copy link
Member

geido commented Feb 22, 2024

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.

@geido geido closed this as completed Feb 22, 2024
@geido geido removed good first issue Good first issues for new contributors need:community-volunteer Requires a community volunteer preset:cares Preset cares about this issue labels Feb 22, 2024
@gstamatakiswxm
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests