用Crystal Report啊, 传入一个DataSet, 就可以了.

解决方案 »

  1.   

    There is a good article c-sharpcorner 
    http://www.c-sharpcorner.com/Graphics/DataGridPrinterMG.asp
      

  2.   

    上www.codeproject.com上有打印DATAGRID的类源码,看看就清楚了。
      

  3.   

    嫌麻烦的话,将数据导到excel
    中打印,如何导的文章在论坛查一下,很多的
      

  4.   

    crystalReportViewer1 是不是就是 Crystal Report阿??
    为什么是传一个dataset而不是datagird呢?
      

  5.   


    代码
    L_ErrMsg.Text = "";
    string sql=L_sql.Text;
    busy.printreport pr =new printreport(); string ConnectionString= connstring;

    System.Data.OleDb.OleDbConnection conn=new System.Data.OleDb.OleDbConnection(ConnectionString);
    try
    {
    busy.companyprint oRpt = new companyprint();
    System.Data.OleDb.OleDbDataAdapter comm=new                    System.Data.OleDb.OleDbDataAdapter(sql,conn);
    DataSet ds = new DataSet();
    comm.Fill(ds,"table");
    oRpt.SetDataSource(ds.Tables["table"]);

    pr.crView.ReportSource=oRpt;
    pr.Show();
    }
               catch(Exception se)
    {
    L_ErrMsg.Text = se.Message;
    }
    printreport 即是你的水晶报表文件 (在这里是生成一个实例)
      

  6.   

    刚才拷错了  companyprint是你添加的水晶报表文件
    printreport 时CrystalReportView 从工具箱拖进去就行了