比如
1、水晶报表
2、自已开发
3、DevExpressDotNetBar
4、GDI++大家都说一说好吗? 自己的项目要选择一个打印的方法!

解决方案 »

  1.   

    比较简单的用PrintDocument
    其实可以输出到Word之类的,然后打印
      

  2.   

    我建议你用Execl到处的方式实现
    http://blog.csdn.net/lin_lujian/article/details/6905917pre class="csharp" name="code">using System;  
    using System.Collections;  
    using System.Configuration;  
    using System.Data;  
    using System.Linq;  
    using System.Web;  
    using System.Web.Security;  
    using System.Web.UI;  
    using System.Web.UI.HtmlControls;  
    using System.Web.UI.WebControls;  
    using System.Web.UI.WebControls.WebParts;  
    using System.Xml.Linq;  
    using System.IO;  
    using System.Data.OleDb;  
      
    public partial class Default3 : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!IsPostBack) {  
                Bind();     //窗体加载时向GridView中填充数据  
            }  
        }  
        PosDataContext pos = new PosDataContext();     //使用Linq to sql进行操作数据库的数据  
        //自定义向GridView控件填充数据方法  
        private void Bind()  
        {  
            GridView1.DataSource = pos.Product.ToList();   //填充数据  
            GridView1.DataKeyNames = new string[] {"Id" }; //设置主键字段  
            GridView1.DataBind();                       //将数据绑定到控件中  
      
        }  
        //导出数据事件  
        protected void btnExcel_Click(object sender, EventArgs e)  
        {  
            Export("application/ms-excel","商品信息报表.xls");  
        }  
        //自定义导出数据的方法  
        private void Export(string FileType, string FileName)  
        {  
            Response.Charset = "GB2312";                 //设置获取输出数据的类型  
            Response.ContentEncoding = System.Text.Encoding.UTF7;  
            //将Http头添加到输出流  
            Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, System.Text.Encoding.UTF8).ToString());  
            Response.ContentType = FileType;  
            this.EnableViewState = false;  
            StringWriter tw = new StringWriter();  
            HtmlTextWriter hw = new HtmlTextWriter(tw);  
            GridView1.RenderControl(hw); //将GridView中的内容输出到指定字符串中  
            Response.Write(tw.ToString());  
            Response.End();           //将当前面的所有缓冲发送到客户端  
        }  
        //如果没有下面方法会报错类型“GridView”的控件“GridView1”必须放在具有 runat=server 的窗体标记内  
        public override void VerifyRenderingInServerForm(Control control)  
        {  
            //base.VerifyRenderingInServerForm(control);  
        }  
        //将Excel中的数据导入到指定控件中  
        public DataSet CreateDataSource() {  
            string strCon = "provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("Excel.xls")+"; Extended Properties= Excle 8.0";  
                OleDbConnection olecon=new OleDbConnection(strCon);  
            OleDbDataAdapter myda=new OleDbDataAdapter("select * from [Sheet1$]",strCon);  
            DataSet myds=new DataSet();  
             myda.Fill(myds);  
            return myds;  
      
      
        }  
        //将数据从Excel导入到指定控件中  
    protected void  btnExcelInfo_Click(object sender, EventArgs e)  
    {  
         GridView1.DataSource= CreateDataSource();  
        GridView1.DataBind();  
    }  
    }  
      

  3.   

    http://download.csdn.net/detail/unicorn_dsx/2866397
    参考这个DEMO,对你有帮助
      

  4.   

    1.纯文本一般用PrintDocument
    2.如果有表格的,一般用报表
      

  5.   

    1.纯文本一般用PrintDocument
    2.表单用水晶报表
      

  6.   

    如果是报表,发票套打,当然是RDLC,MSDN上有不预览直接打印的方法。
      

  7.   

    谢谢大家啦
    我现在用水晶报表,使用push方式
     dataSet_AutiCode1.DataTable1.AddDataTable1Row(str1, str2, str3, str4, str5, str6, str7, str8);                CrystalReport_autiCode cr1 = new CrystalReport_autiCode();
                    cr1.SetDataSource(dataSet_AutiCode1);
                    crystalReportViewer1.ReportSource = cr1;
    有点眉目了,只是还要实现行距、间距、字体之类的调整,希望能成功,grid++,RDLC、GDI+、是什么啊,真是跟不上了,太多新玩意
    谢谢lin_lujian,虽然没试你那个excel的方式,但谢谢你