用Crystal Report啊, 传入一个DataSet, 就可以了.
解决方案 »
- 我做的WinForm程序加上皮肤后页面弹出的时候有闪烁,请问各位大侠咋解决
- 为什么不能按照我的意愿播放下一首MP3?(关于C#播放器)
- 求论坛数据同步方案
- C# 从数据库读出varbinary类型字段 并将其写入txt文件
- !!如何把datatable中的数据更新到DB中!!
- WinForm 中 数据库里面来了新数据 如何让winform中的那条记录红色闪烁????
- 如何更改datagrid显示的值?
- 请问各位大侠,开发大型的WEB站点(上线人在1万人以上),是采用分布式Web Services还是NET Remoting技术最好?
- 怎么实现控件的旋转?
- C#怎么实现exe带参数
- 在线等待:100分求一简单答案.在C#中自己定义了一个类publicFun.cs,问题如下:
- 如何可以把DataGrid中符合条件的cell设置为不可以编辑.
http://www.c-sharpcorner.com/Graphics/DataGridPrinterMG.asp
中打印,如何导的文章在论坛查一下,很多的
为什么是传一个dataset而不是datagird呢?
代码
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 即是你的水晶报表文件 (在这里是生成一个实例)
printreport 时CrystalReportView 从工具箱拖进去就行了