哪位高手有用过C#2005的reportViewer报表控件呢?
最近有一项目,需要做报表,可是以前都没有做过.在C#2005里面有带一reportviewer控件,不会用,有哪位高手有用过的,给些原代码看看.网上找了很久没有找到相应的,写的比较详细的资料.本人是菜鸟..没办法,请高手帮帮忙!~~~~
------解决方案--------------------第一.在一个窗里拉一个CrystalReportViewer
------解决方案--------------------http://msdn2.microsoft.com/zh-cn/library/ms251686(VS.80).aspx
http://book.csdn.net/bookfiles/174/1001747869.shtml
------解决方案--------------------然在page_load
string connStr =ConfigurationSettings.AppSettings[ "ConnString1 "].ToString();
SqlDataSource datasource = new SqlDataSource(connStr, 你的SQL语句);
ReportDocument doc = new ReportDocument();
TableLogOnInfo logininfo = new TableLogOnInfo();
string path;
path = Server.MapPath( "report1.rpt ");
doc.Load(path);
string a, b, c, d;
a = System.Configuration.ConfigurationManager.AppSettings[0];
b = System.Configuration.ConfigurationManager.AppSettings[1];
c = System.Configuration.ConfigurationManager.AppSettings[2];
d = System.Configuration.ConfigurationManager.AppSettings[3];
logininfo.ConnectionInfo.ServerName = a;
logininfo.ConnectionInfo.DatabaseName = b;
logininfo.ConnectionInfo.UserID = c;
logininfo.ConnectionInfo.Password = d;
doc.Database.Tables[0].ApplyLogOnInfo(logininfo);
doc.Database.Tables[0].SetDataSource(datasource.Select(DataSourceSelectArguments.Empty));
CrystalReportViewer1.ReportSource = doc;
然后用自带的报表画一个相应的报表,可以解决了.
------解决方案--------------------楼上都说完了,其实报表就是那么简单,无非就是拉几个数据了。
------解决方案--------------------报表打印控件wsReport4.6
------解决方案--------------------ms-help://MS.MSDNQTR.v80.chs/MS.MSDN.v80/MS.VisualStudio.v80.chs/rs_vsrpts/html/af5c3532-f8ed-46f3-b3bc-5fab89fdc553.htm
ms-help://MS.MSDNQTR.v80.chs/MS.MSDN.v80/MS.VisualStudio.v80.chs/rs_vsrpts/html/1c7cf8b9-3586-45e7-ba87-1e1bff053adb.htm
http://msdn2.microsoft.com/zh-cn/library/ms251671(VS.80).aspx
http://www.cnblogs.com/waxdoll/category/49402.html
http://www.microsoft.com/china/msdn/events/webcasts/shared/webcast/downloadarchive.aspx
http://www.codeproject.com/aspnet/ReportViewer.asp
http://www.cnblogs.com/Carlwave/archive/2006/08/09/472312.html
http://hi.baidu.com/lffy5267/blog/item/43384b3d7052d8ee3c6d97ec.html