I found the root cause.
IE doesn’t like the new window name to have spacebar. So we must change this line
w=window.open(null, 'Print_Page', 'scrollbars=yes');
Then we still cannot print yet. There must be this line
w.document.close();
before the print command
w.print();
Now it works.