We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem with Grid print

Thread ID:





143753 Apr 3,2019 09:47 PM UTC Apr 5,2019 06:57 AM UTC React - EJ 2 4
Tags: Grid
Ali Rahighi
Asked On April 3, 2019 09:47 PM UTC

Hi there
I have problem with print functionality 

when I call the grid.print()
I came to following error :

Is there any things further I should consider? I'd just followed the examples...
TypeError: Cannot read property 'moveTo' of null
  75 | Print.prototype.print = function () {
76 | this.renderPrintGrid();
77 | this.printWind = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
> 78 | this.printWind.moveTo(0, 0);
| ^ 79 | this.printWind.resizeTo(screen.availWidth, screen.availHeight);
80 | };
81 |
  2598 | 
2599 | Grid.prototype.print = function () {
2600 | if (this.printModule) {
> 2601 | this.printModule.print();
| ^ 2602 | }
2603 | };
2604 | /**
  50 |             this.grid.csvExport();
51 | break;
52 | case 'Print':
> 53 | this.grid.print();
| ^ 54 | break;
55 | }
56 | }

Hariharan J V [Syncfusion]
Replied On April 4, 2019 12:19 PM UTC

Hi Ali Rahighi, 

As we have validated the your query provided the information and we suspect that script error(“TypeError: Cannot read property 'moveTo' of null”) thrown when we print the our EJ2 Grid even the browser were block the pop-up in corresponding page. We suggest you to ensure the browser pop-up state change or not while the Print the EJ2 Grid. For your reference we have share the issue reproduced the screenshot with cause of that defect too. 


Please get back to us, if you need further assistance. 


Ali Rahighi
Replied On April 4, 2019 07:27 PM UTC

Thanks for your attention Hariharan J V
The debugging information I've provided is for when I use chrome debug and putting break point on grid.print() code and step by step debugging  in vs code
On the other hand without any break points there is different error in browser console and that's this :

      I must add pop up is allowed because an empty  print page opens when I click the print button

Ali Rahighi
Replied On April 4, 2019 08:34 PM UTC

I think I found it!!
And it seems it's a BUG
because when I set the allowGrouping to TRUE this happens to me.
you can reproduce the bug just by adding allowGrouping={true} (and do not add the Group service in Inject tag)
this was remained lonely after I removed the Group service injection.
It's better to fix this issue it took me a long time :))

Hariharan J V [Syncfusion]
Replied On April 5, 2019 06:57 AM UTC

Hi Ali Rahighi, 
Thanks for your update. 
This is not a bug. This is the default behavior which we have stated already in our Documentation. In order to use grouping  We must need to inject the grouping service. Otherwise it may not work. So we suggest you to Inject the required services before using a feature. 
Please refer the following documentation more information: 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon