如题

解决方案 »

  1.   

    不懂
    我的代码是
     <script language="JavaScript" type="text/javascript">function dayin()  
    {
      var code=document.all.dayin.innerHTML;
      code+="<object id='wb' name='wb'  height='0' width='0'  classid='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object>"
      code+="<input type='button' value='打印机设置' style='border: solid 1px #a3a3a3; background-color: #e6e6e6; font-size: 12px' class='noprint' onclick='javascript:wb.execWB(8,1);' />&nbsp;&nbsp; <input type='button' value='打印预览' style='border: solid 1px #a3a3a3; background-color: #e6e6e6; font-size: 12px' class='noprint' onclick='javascript:wb.execWB(7,1);' />&nbsp;&nbsp; <input type='button' value=' 打 印 ' style='border: solid 1px #a3a3a3; background-color: #e6e6e6; font-size: 12px' class='noprint' onclick='javascript:wb.execWB(6,1);' />"
      code+="<style media='print' type='text/css'> .Noprint{display:none;} .PageNext{page-break-after: always;} </style>"
    var newwin=window.open('','','');
      newwin.opener = null;
      newwin.document.write(code);
      newwin.document.close();
    }
    </script>
    <input type="button" value="打印预览查询内容" onclick="dayin()"/>
     <div id="dayin()"><asp:GridView ID="GridView1" runat="server" Font-Size="12px" AllowPaging="true" AllowSorting="true"
                                        OnRowCreated="GridView1_RowCreated" PageSize="10" EmptyDataText="没有符合要求的数据!">
                                        <PagerSettings Mode="NumericFirstLast"></PagerSettings>
                                    </asp:GridView></div>
    可是我那个表太长啦 无法在一张纸上呈现 横竖都不行
    就想能不能换页打印
    谢谢
      

  2.   

    <asp:GridView ID="GridView1" 
    Width="100%" runat="server" Font-Size="12px" AllowPaging="true" AllowSorting="true" 
                                        OnRowCreated="GridView1_RowCreated" PageSize="10" EmptyDataText="没有符合要求的数据!"> 
                                        <PagerSettings Mode="NumericFirstLast"> </PagerSettings> 
                                    </asp:GridView>