ReactJS components for PDF export, Excel export and print

Viewed 28352

I´m building some ReactJS Table and Report components tha basically will contain <table> data, some graphics (d3) and some textual data. I need to provide 3 buttons:

  1. Export to PDF
  2. Export to Excel
  3. Print

Are there any trustable packages available for the tasks above using ReactJS ? What is the approach to handle these requirements ?

3 Answers
  1. react-pdf (published 16 days ago - not tested)
  2. react-export-excel (published 8 months ago - not tested)
  3. For printing, put window.print() in your code

Example: Copy and paste this as .html (in React, it would be onClick={window.print()} ... If I'm correct)

<!Doctype html>
<html>
  <body>
    <p>Use the button below to print</p>
    <button id="print" onclick="window.print()">Print</button>
  </body>
</html>

Old question, but since I was looking for something similar, I ended up using :

  1. jspdf (see specific issue for reactjs)
  2. react-excel-workbook
  3. nothing yet, feel free to update the answer if you have.
Related