free asked 3 years ago

I am going to show different reports from json data and for that reason the best component that I thought that may be helpful is "Table". I wonder how I can print the content of "Table"? Do you have any tools for that? Thanks in advance

Aliaksandr Andrasiuk staff answered 3 years ago


You can try to use exportToCSV property :


It will render a button which allows you to download all the Table's data as .csv file. You can open this file by Microsoft Excel, for example, and then print it.

Hope I could help. free commented 3 years ago

Thanks for your answer. Its not for my use to do this way, its for clients of my app and I need to have a print button on form to print it and this solution doesn't work, is there any other solution?

Aliaksandr Andrasiuk staff commented 3 years ago


ExportToCSV uses the same named component, which you can import and add to your form component. This component excepts 2 properties: columns and data. You can pass a data.rows as data value.

So your imported ExportToCSV component will look like this:

import { MDBDataTable, ExportToCSV } from "mdbreact";

 <ExportToCSV columns={data.columns} data={data.rows} color="primary">

You can try this approach. I hope this will meet your exceptions.

Best regards.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.13.0
  • Device: mac
  • Browser: chrome
  • OS: macos
  • Provided sample code: No
  • Provided link: No