<%@ 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>
<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。或者有那种把数据调用到另一页在打印也好,不知道怎么做?
问题解决,会给大家加分!谢谢
<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>
<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。或者有那种把数据调用到另一页在打印也好,不知道怎么做?
问题解决,会给大家加分!谢谢
报表打印控件wsReport4.6