Template columns do not show when printing

I'm trying to print template columns on the grid, but as soon as I click print the columns disappear. Is there settings or props that I need to use in order to get those columns to show on print?

Before Print: 

After Print:



5 Replies

IS ismail July 6, 2022 08:08 PM UTC

Any solution for that? I have the same problem.



NS Nithya Sivaprakasam Syncfusion Team July 7, 2022 05:51 PM UTC

Hi Customer,


We are checking your query at our end and will update further details tomorrow (07/07/2022). Until then we appreciate your patience.


Regards,

Nithya S



NS Nithya Sivaprakasam Syncfusion Team July 8, 2022 06:11 PM UTC

Hi Juliet,


Sorry for the inconvenience caused.


Currently, we are validating your query with high priority but we need extra time. So, we will update further details within two business days(13/07/2022). Until then we appreciate your patience.


Regards,

Nithya Sivaprakasam.



JK Juliet King July 15, 2022 01:21 PM UTC

Has this been solved yet?



NS Nithya Sivaprakasam Syncfusion Team July 15, 2022 01:27 PM UTC

Hi Juliet,


Sorry for the inconvenience caused.


Query: “Template columns do not show when printing”


When using template columns the values are passed by using props in react. So, it causes an empty column while printing. We have prepared a workaround sample to achieve your requirement.


To print the columns correctly while using template columns, use the following code in the beforeprint  Method.


Index.js

 

beforePrint (args) {

    let tbodyEle = this.grid.element.querySelector('.e-gridcontent .e-content tbody').cloneNode(true);

    let arrOfChildren = tbodyEle.children;

    args.element.querySelector('.e-gridcontent .e-content tbody').replaceChildren(...[].slice.call(arrOfChildren));

  }


Please refer to the below sample for more reference.


Sample: https://stackblitz.com/edit/react-nzgkaq-rmtgr5?file=index.js


Documentation: https://ej2.syncfusion.com/react/documentation/api/grid/#beforeprint


Please get back to us if you need further assistance on this.


Regards,

Nithya Sivaprakasam.


Loader.
Up arrow icon