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

Export to PDF leaves charts empty on first export #27532

Open
3 tasks done
ignasv opened this issue Mar 15, 2024 · 8 comments
Open
3 tasks done

Export to PDF leaves charts empty on first export #27532

ignasv opened this issue Mar 15, 2024 · 8 comments
Assignees

Comments

@ignasv
Copy link

ignasv commented Mar 15, 2024

Bug description

When using the new Export to PDF functionality, we get a mostly empty PDF on the first try. Second export usually works fine. If we refresh the page - same issues reappear: first export is empty, second is fine.

The issue does not seem to impact Big Number and Table charts. But everything else: Pie Charts, Bar Charts, Area Charts, seem to be impacted.

How to reproduce the bug

  1. Open a dashboard which has a Pie Chart.
  2. Click Export to PDF
  3. Check PDF

Screenshots/recordings

First click on Export to PDF:
Screenshot 2024-03-15 at 14 50 04

Second click on Export to PDF:
Screenshot 2024-03-15 at 14 50 30

Superset version

3.1.1

Python version

3.10

Node version

Not applicable

Browser

Safari

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@Arcelone
Copy link

Arcelone commented Jun 18, 2024

Same issue for me, with the 4.0.1 version of superset.

@Spragalas
Copy link

I also face exact same issue (4.0.1)

@hanslemm
Copy link
Contributor

hanslemm commented Jul 4, 2024

Same problem, but worst:

  • For me it only prints what is visible on the screen. Anything outside it is not printed, but rather shows the Superset loading logo.

Is this using the webdriver component? If yes, perhaps it is not waiting long enough to take the screenshot.

@Arcelone
Copy link

Arcelone commented Jul 6, 2024

@hanslemm i think this is the issue. I don't know which technology they use to generate the pdf. But it may be just a option to force the rendering of all the page and not only the visible part.

@artyom738
Copy link

artyom738 commented Jul 23, 2024

Similar problem with embedded dashboard.
When we export embedded dashboard, only visible charts are saved in pdf. If some charts are out of screen, in pdf we have loading logo instead of charts. I have attached a screenshot.

But when we export dashboard from superset (not embedded), pdf is saving correctly.

In addition (maybe it can help) - if you will try to scroll embedded dashboard quicky, you will see a loading logo by a millisecond before chart renders. It seems like charts that are out of screen are unloading.

UPDATE: I have debugged it - there is DASHBOARD_VIRTUALIZATION feature flag. If it is True, charts out of screen are removing from DOM. I set it False and export embedded dashboard now is working correctly. Maybe it would be right if all charts will be loaded back before exporting to pdf?

Снимок экрана от 2024-07-23 11-18-42

@rusackas
Copy link
Member

We suspect that this might be resolved in the current 4.1 release candidate. Please test and vote accordingly! Let me know if you need help with that, and make sure you subscribe to the [email protected] mailing list (just send an email to [email protected])

@Xyrai
Copy link

Xyrai commented Aug 1, 2024

@rusackas could this fix also get implemented within the @superset-ui/embedded-sdk NPM package?

When my users try to print their page via the browser functionality, the same issue occurs where any chart outside of the viewport doesn't get rendered but displays the "loading" status instead.

@jpchev
Copy link

jpchev commented Nov 15, 2024

We suspect that this might be resolved in the current 4.1 release candidate. Please test and vote accordingly! Let me know if you need help with that, and make sure you subscribe to the [email protected] mailing list (just send an email to [email protected])

hello, I'm testing witht the latest dev code, the issue is still present, there is no guarantee that all the charts of a dashboard are being sent to the pdf generation module.

BTW, is it possible to have Apache Superset generate the pdf on the server side?

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

No branches or pull requests

9 participants