我搜索出来的全部数据赋值给DataTable,然后我想把datatable中的全部数据打印出来(点打印按钮先出来打印预览对话框),然后再点击打印就打印了(最好要是能够打印多页数据,并且可以传递一个标题),因为打印需要一个标题。

解决方案 »

  1.   

    简单一点的报表控件Active Report等
      

  2.   

    使用GDI+自己画我就是这么搞的·~~PS:不要认为打印很难,但是打印控制的确不是很简单·~~
    你的寥寥几句话实现起来其实很麻烦(如果是用GDI+的话),涉及到换行,分页这些,字体大小这些~~~
    但是如果用水晶报表,那就简单太多了·
      

  3.   

    使用printdocument可实现分页打开
      

  4.   

    打印机器是不会分页的,可以利用css样式分页  帮你找找代码 。。
      

  5.   


    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>   
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    <html xmlns="http://www.w3.org/1999/xhtml">   
    <head runat="server">   
        <title>无标题页</title>   
        <mce:style type="text/css" media="print,screen"><!--   
            th   
            {   
                font-family: Arial;   
                color: black;   
                background-color: lightgrey;   
            }   
            thead   
            {   
                display: table-header-group;   
            }   
            tbody   
            {   
                display: table-row-group;   
            }   
           
    --></mce:style><style type="text/css" media="print,screen" mce_bogus="1">        th   
            {   
                font-family: Arial;   
                color: black;   
                background-color: lightgrey;   
            }   
            thead   
            {   
                display: table-header-group;   
            }   
            tbody   
            {   
                display: table-row-group;   
            }   
        </style>   
    </head>   
    <body style="text-align: center;" mce_style="text-align: center;">   
        <form id="form1" runat="server">   
        <div style="width: 100%; text-align: center;">   
            <table>   
                <tr>   
                    <th>   
                        就第一页有   
                    </th>   
                    <th>   
                        First Name   
                    </th>   
                    <th>   
                        Last Name   
                    </th>   
                </tr>   
                <tr>   
                    <th>   
                        就第一页有   
                    </th>   
                    <th>   
                        First Name   
                    </th>   
                    <th>   
                        Last Name   
                    </th>   
                </tr>   
            </table>   
            <table border="1" cellpadding="2" cellspacing="0">   
                <thead>   
                    <tr>   
                        <th>   
                            ID   
                        </th>   
                        <th>   
                            First Name   
                        </th>   
                        <th>   
                            Last Name   
                        </th>   
                    </tr>   
                </thead>   
                <tbody>   
                    <cfoutput query = "query_name"   group = "query_column" >   
                <cfloop from="1" to="50" index="11" >   
                <tbody id="ttable" runat="server">   
        
                </tbody>    
                </cfloop>   
            </cfoutput>   
                </tbody>   
            </table>   
        </div>   
        </form>   
    </body>   
    </html>  
    本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/guoyz_1/archive/2009/10/27/4732980.aspxpublic partial class _Default : System.Web.UI.Page   
    {   
        protected void Page_Load(object sender, EventArgs e)   
        {   
            if (!IsPostBack)   
            {   
                for (int i = 0; i < 200; i++)   
                {   
                    ttable.InnerHtml += "<tr><td>#"+i.ToString()+"#</td><td>First Name #i#</td><td>Last Name #i#</td></tr>";   
                }   
            }   
        }   
    }  本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/guoyz_1/archive/2009/10/27/4732980.aspx
      

  6.   

    [email protected] 呵呵给我一个谢谢
      

  7.   

    群主也给我一份,急需,邮箱[email protected].谢谢。