core: Unable to export all data as PDF or CSV

Describe the bug ok, while now I can at least see the export button and can export the data as PDF or CSV, clicking this button ONLY exports visible data from the browser. If I change the ExportPdf() function by supplying it with an array of all of my data, I get a report with blanks i.e. not data gets exported…just column headers and several pages of blank rows underneath.

For CSV, If I include the entire dataset array, I get an error…see below

TypeError: console.err is not a function

node_modules/@material-table/exporters/csv/index.js

return col.title;
    })).addRows(Array.from(data)).exportFile();
  } catch (err) {
    console.err("err in ExportCsv : ".concat(err));
  }
}

I tried to add console.log() to see the data and can see all 175 JSON objects. As it stands, the export is not useful as we can’t expect users to export every single page individually … is there anything I am missing here? I’ve updated the sandbox to reflect this and you will find exactly identical results…

To Reproduce

https://codesandbox.io/s/elegant-lalande-3teq8?file=/src/App.js

Expected behavior

MT should allow ALL data to be exported as PDF and CSV, not just visible data. Also, it would be an added bonus if we can export the Title.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (11 by maintainers)

Most upvoted comments

Cheers!

Yay… mate, you are a legend. 😃

I used your logic for both i.e. PDF and CSV and now can see all rows… phew…!!!

Thank you so very much for your prompt help. Much appreciated.

@DewangS actually, use v1.0.7 - I forgot to make the same change for ExportPdf… apologies.

I’m not sure I follow. Would you mind creating a sandbox?

Edit: didn’t see the sandbox at first. Looking at it now.