Author Topic: Export to excel with innerText of grid column  (Read 2785 times)

Param Query Eval

  • Newbie
  • *
  • Posts: 15
    • View Profile
Export to excel with innerText of grid column
« on: March 16, 2020, 07:04:38 pm »
Hi Paramvir,
We have done little customization on column rendering(Added few dynamic classes and prepend with few popover plugins through i tag).
When i export to excel, html string added in column rendering is coming as plain text for the specific column. Is there any way we can customize and export innerText without any plain HTML or is there any other way to achieve the same?

Also, observed that when we export to excel with bulk data, to say around 10k rows, usually it exports in 10-15 secs. but sometimes it takes around 50-60 secs. Is it an exiting behavior or is there anything can be done to make it consistent way.[however grid renders very fast in 2 to 3 seconds.]

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Export to excel with innerText of grid column
« Reply #1 on: March 17, 2020, 06:06:52 pm »
Pass render: false to exportData method to solve both issues. Also ensure that none of the columns has exportRender option.

Param Query Eval

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Export to excel with innerText of grid column
« Reply #2 on: March 18, 2020, 04:24:48 pm »
Thanks, when we passed render: false to exportData method, it solves plain html string issue for customized render column and increased performance. But we have faced an another issue where some calculated column values are not rendered for all rows.[PFA for reference]. so we have combined render: false and exportRender: true[for calculated columns] to solve the issue.
Reference link: we have done weekly summary calculation as per earlier thread suggestion.
https://paramquery.com/forum/index.php?topic=3551.0

Also we observed when we export using https://paramquery.com/jszip-2.5.0/filesaver.js, it is working fine in Firebox, but in Chrome it opens file in new tab with file name "download", no extension. i'm quite surprise to see that the below demo is working fine in chrome
which refers above fileSaver libraryhttps://paramquery.com/pro/demos/export_local.
So we have referenced https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js which works fine in both Firebox and Chrome. I'm not sure if anyone else faced the same issue and what is cause for the same.
« Last Edit: March 18, 2020, 04:27:01 pm by Param Query Eval »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Export to excel with innerText of grid column
« Reply #3 on: March 20, 2020, 12:27:59 pm »
I'm glad that you worked out the use case w.r.t. render / exportRender options.

I can check if you have a jsfiddle to share reproducing the issue with filesaver.