<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DataToPrint.aspx.cs" Inherits="DataToPrint" %><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width: 149px">
            <tr>
                <td colspan="3" rowspan="3" style="height: 115px">
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                        DataSourceID="SqlDataSource1" Height="134px" PageSize="5" Width="255px">
                    </asp:GridView>
                </td>
            </tr>
            <tr>
            </tr>
            <tr>
            </tr>
        </table>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:pubsConnectionString2 %>"
            SelectCommand="SELECT * FROM [authors]"></asp:SqlDataSource>
        &nbsp;
            <p>
            <OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0> 
</OBJECT> 
        <input id="Button1" type="button"  onclick=document.all.WebBrowser.ExecWB(7,1) value="打印" />
<br />
</p>
    
    </div>
    </form>
</body>
</html>禁不住想问:
1。数据库连接的是PUBS.因为GRIDVIEW是换页的.点打印按钮时候,打印预览只有当前页数据没有换页的数据,如何解决?
2。或者有那种把数据调用到另一页在打印也好,不知道怎么做?
问题解决,会给大家加分!谢谢

解决方案 »

  1.   

    GridVieW 的打印.没弄过?
      

  2.   


    报表打印控件wsReport4.6 
      

  3.   

    在打印之前加个 GridView1.AllowPaging = false;就OK
      

  4.   

    在打印之前加个 GridView1.AllowPaging = false;就OKer我的意思是 分页的数据也能打印,在预揽的时候是分页的。
      

  5.   

    报表打印控件wsReport4.6 有下载的地址么?给个看看,不过我这个不时报表,只是那GRIDVIEW的数据直接从WEB页面导出打印的,.当时就是这样.ADIDAS.