Javascript 0x800a138f-Microsoft JScript运行时错误:无法获取属性';文件';:对象为null或未定义

Javascript 0x800a138f-Microsoft JScript运行时错误:无法获取属性';文件';:对象为null或未定义,javascript,html,Javascript,Html,当我在IE9中打印网格时,我得到了这个javascript运行时 错误(0x800a138f-Microsoft JScript运行时错误:无法获取属性“document”的值:对象为null或未定义) 但在其他浏览器中,如chrome、mozila,其工作正常,但在IE9中出现此错误,我的代码如下所示 <asp:GridView ID="grdprint" runat="server" AllowPaging="false"

当我在IE9中打印网格时,我得到了这个javascript运行时

错误(0x800a138f-Microsoft JScript运行时错误:无法获取属性“document”的值:对象为null或未定义)

但在其他浏览器中,如chrome、mozila,其工作正常,但在IE9中出现此错误,我的代码如下所示

 <asp:GridView ID="grdprint" runat="server" AllowPaging="false"                                      AllowSorting="True"AutoGenerateColumns="False"   Width="100%" Font-Size="12px"><RowStyle CssClass="normal" Font-Size="12px" /><HeaderStyle Font-Size="12px" />
                    <PagerStyle CssClass="pgr" />
                   <Columns>
                        <%-- <asp:TemplateField HeaderText="Product Code">
                    <ItemTemplate>
                        <asp:Label ID="lblProductCode" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ProductCode") %>'/>                           
                    </ItemTemplate>                        
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>--%>
                           <asp:TemplateField HeaderText="Product Name">                       
                    <ItemTemplate>
                        <asp:Label ID="lblProductName" runat="server"  Text='<%# DataBinder.Eval(Container.DataItem, "ProductName") %>'/>
                    </ItemTemplate>   
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField> 
                           <asp:TemplateField HeaderText="Quantity">                        
                    <ItemTemplate>
                        <asp:Label ID="lblQuantity" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Quantity") %>' />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField> 
                    <asp:TemplateField HeaderText="Rate">
                    <ItemTemplate>
                        <asp:Label ID="lblRate" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Rate") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Amount">
                    <ItemTemplate>
                        <asp:Label ID="lblAmount" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Amount") %>' />
                    </ItemTemplate>

                </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                     </td></tr>
                     <tr>
                            <td style="padding-right:10px;float:right;">
                                 <b style="font-size:12px;">Total Amount :</b>
                                 <b >&nbsp;&nbsp;
                                    <asp:Label ID="lblptotalamt" runat="server" Font-Bold="true" Font-Size="11px"></asp:Label>
                                </b><br />
                            </td>

                     </tr>
                 <tr>
                    <td align="center">
                        <asp:Label ID="Label2" runat="server" Font-Bold="true" Font-Size="10px" ForeColor="BlueViolet"></asp:Label>
                    </td>
                 </tr>
                  <tr>
                    <td align="center">
                        <asp:Label ID="lblword" runat="server" Font-Bold="true" Font-Size="10px"></asp:Label>
                    </td>
                 </tr>
             <tr>
                    <td align="center">
                        <asp:Label ID="lblthnk" runat="server" Font-Bold="true" Font-Size="10px" Text="** Thank You * Visit Again **"></asp:Label>
                    </td>
                 </tr>
                     </table>
          <%--  </asp:Panel>--%>
        </div>
    </div>
从Word上的此行获取错误

printWindows.document.write('<html><head><title>Sales Reports</title>');

  <script type = "text/javascript">  
    function PrintPanel()     {    
  var panel = document.getElementById("<%=pnlContentss.ClientID%>");
  var printWindows = window.open('','','height=600,width=800');
  printWindows.document.write('<html><head<title>SalesReports</title>');
  printWindows.document.write('</head><body >');  
  printWindows.document.write(panel.innerHTML);   
  printWindows.document.write('</body></html>');   
  printWindows.document.close();  
  setTimeout(function () {  
  printWindow.print();  
  }, 500);
   return false;
   }
  </script>

i need to print in IE 9 please help me friends..
printWindows.document.write('Sales Reports');
函数PrintPanel(){
var panel=document.getElementById(“”);
var printWindows=window.open('',''高度=600,宽度=800');
printWindows.document.write('