首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

WEB页打印有关问题

2011-12-22 
WEB页打印问题%@PageLanguage C# AutoEventWireup true CodeFile DataToPrint.aspx.cs Inherits

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



[解决办法]
在打印之前加个 GridView1.AllowPaging = false;就OK
[解决办法]
UP

热点排行