Code Monkey home page Code Monkey logo

Comments (1)

pashkov-v avatar pashkov-v commented on July 18, 2024

I've implemented PDF reports generation based on DataLens dashboards using Puppeteer. There are several major obstacles in this approach.

  1. One should pass page width for each tab so that all elements fit into PDF page. Page height is available via .react-grid-layout.
  2. DataLens loads widgets lazily, hence one needs to set viewport size equal to the page size so that all elements are loaded simultaneously. But in this way, a single tab with many widgets may load longer than default navigation timeout of 30 seconds, so one needs to adjust this timeout. Plus one may get errors from data source because it may not allow too many simultaneous connections.
  3. .dash-tabs element breaks PDF page width in case of a dashboard with multiple tabs. So it should be removed from the page before executing page.pdf() (although in my opinion horizontal tabs list is pointless in case of PDF reports, so that's a good thing that they should be removed).

It is also possible to remove some buttons from web page before rendering it as PDF.

from datalens.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.