Giter Club home page Giter Club logo

Comments (3)

bakesteve avatar bakesteve commented on June 3, 2024

Excel is a bit harder. Basically you have a few options, the easiest being to send html down to excel but with the appropriate headers. However, excels HTML rendering engine is fairly basic. So it makes exporting a grid like this pretty hard (ie it wont understand floated divs).

Pdfs are a little easier in principal. We use a node based process internally that, basically, uses phantomJS, grabs a screenshot as an image, and then converts that to a pdf. BUt there are a bunch of other alternatives.

One more fundamental issue, depending on your use case, is that the grid is designed to only render the rows in view. So if you have 1000 rows, we only show 20 (or whatever you have set for your viewport). Depending on what you are trying to achieve, that may not be correct.

In terms of adding this as a feature, I think it probably sits out of scope for the core library. But an add on to either render the rows and cells in Excel compatible html (basically <tr> and <td> and / or an add on that pushes out a pdf (ideally browser based, but not seen anything reliable there) would be something we'd consider

@malonecj @jpdriver chip in if anything you'd add here

from react-data-grid.

jpdriver avatar jpdriver commented on June 3, 2024

for Excel it probably depends on whether or not you need the HTML markup in your resulting spreadsheet. IMO it makes more sense to get the rows from the grid state and pass that a JSON --> CSV converter.

I'm using the grid in a project where I'm doing that the other way (CSV --> React Data Grid) for initial data load so should be easy enough to do the other way, and there are lots of npm packages that do JSON <---> CSV.

for PDF's @bakesteve 's right -- PhantomJS is probably the easiest way to go. It actually natively supports rendering as a PDF (see http://phantomjs.org/screen-capture.html), though as mentioned you might need to fiddle with the styling to display rows beyond what the Viewport is currently rendering.

from react-data-grid.

zomars avatar zomars commented on June 3, 2024

@jpdriver can you recommend a npm package for JSON to CSV? I'm also trying to export a generated table to CSV. Thanks you for any info that you could provide!

from react-data-grid.

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.