C#中水晶报表实例

 

解决方案-->右击添加新建项-->Crystal报表-->确定,出现如下图表:按确定,(使用报表向导)



确定后出现如下图:



选择创建新连接中的”OLE DB(ADO)”如下图所示:



双击或单击” OLE DB(ADO)”出现如下图:



选择光标所在行,Microsoft OLE DB Provider for SQL Server单击下一步,出现如下图:



选择默认的第一项,直接点完成.又回到了先前第一步的图,只不过现在可以让你选择所操作的数据库了.如下图所示:



是这样吗?用户刚选择的t74数据库表是不是已经存在了.OK,点开看看,是不是有你想要操作的表了:如下图所示:



OK,这样你想操作哪个表就操作哪个表了.点击下一步,如下图所示:



是这样吗?看看,主外键关系全都自动给你匹配好了.点击下一步,如下图所示:



如你想要显示什么字段就直接添加到右边去便可以了.是不是用起来很爽呢.下一步:如下图:



OK,你想根据什么字段分组呢?按升序or降序?如你所愿,选吧~.下一步,下一步,全都看自己意愿了.呵呵,本人一般猛点下一步,不讲究什么漂不漂亮,出来就可以了.
说说注意的一点:如有想选择表格显示出来的,就得留心选下以表的样式显示, 如下图所示:





OK,
完成,当然现在的报表还是很乱,如下所示,




不过没关系嘛,你可以直接在上面编辑的,可以把英文改为中文,如下所示,



是不是,选中一个文本框,右击便可以了,是不是有蛮多的操作,自己都可以去试试的.

OK,报表是差不多建好了,怎么去用呢?
没关系,下面就讲咯.
下面我们就随便添加一个窗体,然后在工具箱中脱个报表视图放于窗体中








就右边这个东东很有用处
,当然有时我们没必要这样做,但关键时刻还是挺有用处的,
你可以把左边的树不显示出来,你可以选择你所创建的水晶报表,,这个挺有用的,我们刚不是创建了个水晶报表了吗?这下可以在这里使用到了,呵呵.,看看.



弹出了这样一个对话框,我选择我刚所创建的报表,CrystalReport2.rpt.
OK,来了,当然最后结果还是不给大家呈现出来了,报表做的实在太烂了,呵呵,经过你们自己的创新与精雕定会有漂亮的报表出来的,呵呵,完了.去试试吧.

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
Crystal Reports for Visual Studio 2005 SDK Tutorials: Sample Code Projects 1. This setup contains sample code projects for Crystal Reports for Visual Studio 2005. 2. This sample code corresponds exactly to the tutorials contained in the Crystal Reports for Visual Studio 2005 online help. Each project has been built by following the instructions in their corresponding tutorials, and instructions and explanations have been placed within the tutorial sections rather than in code comments. Therefore, it is highly recommended that you consult the tutorials for a full explanation of the structure and best practices demonstrated within this code. 3. If you wish to run the tutorial sample code projects, check the code for any machine-specific values and confirm that they are customized for your specific machine. These may include: * ODBC data source settings for reports * file directory paths * network printer paths * API property settings for database connections, including: * database server names * database names * userIDs * passwords * complete database connection strings 4. For security reasons it is recommended that you use Integrated Security (Windows Authentication) for your SQL Server database connectivity. If you plan to use SQL Authentication, it is strongly recommended that you create a database account with limited access to your database. (Both versions of authentication are demonstrated in the tutorials.) For more information on security, including how to create a limited access database account, see the SDK Fundamentals section of the Crystal Reports for Visual Studio 2005 documentation. Asp.net2.0水晶报表(CrystalReports)事例源码大全(C#) 这些例子实现了水晶报表的查看、柱状图显示、打印、导出、缩放等基本功能,如果想了解更多比如说利用DataSet方式、Push、Pull等模式需要自己更深一步的研究了 难得的Asp.net2.0水晶报表源码,请珍藏!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值