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:
Any solution for that? I have the same problem.
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
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.
Has this been solved yet?
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.