.NET开发

本类阅读TOP10

·NHibernate快速指南(翻译)
·vs.net 2005中文版下载地址收藏
·【小技巧】一个判断session是否过期的小技巧
·VB/ASP 调用 SQL Server 的存储过程
·?dos下编译.net程序找不到csc.exe文件
·通过Web Services上传和下载文件
·学习笔记(补)《.NET框架程序设计(修订版)》--目录
·VB.NET实现DirectDraw9 (2) 动画
·VB.NET实现DirectDraw9 (1) 托管的DDraw
·建站框架规范书之——文件命名

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
使用5种不同的方法加载水晶报表(Windows 窗体)

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

1、代码下载:http://support.crystaldecisions.com/communityCS/FilesAndUpdates/vbnet_win_simplepreviewreport.exe.asp?recDnlReq=Record&dnlPath=vbnet_win_simplepreviewreport.exe

2、用作 viewer.reportsource 的5种类型的报表:

 - 使用 Report 名 (通过文本路径)
 - 使用 Report 对象 (通过文本路径)
 - 使用非类型的 Report 组件 (通过文本路径和 ReportDocument reportdocument1)
 - 使用 Report 对象 (通过已添加到项目的报表文件,如:World Sales Report.rpt)
 - 使用强类型的 Report 组件()(通过 ReportDocument world_Sales_Report1)
 
注:Report 组件即“工具箱”-〉“组件”-〉“ReportDocument”

3、代码简介:
- 使用 Report 名 (通过文本路径)
CrystalReportViewer1.ReportSource = "C:\Crystal\crnet\vbnet_win_simplepreviewreport\World Sales Report.rpt"
 '--------------------------------------------------------------------
- 使用 Report 对象 (通过文本路径)
Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
crReportDocument.Load("C:\Crystal\crnet\vbnet_win_simplepreviewreport\World Sales Report.rpt")
CrystalReportViewer1.ReportSource = crReportDocument
 '--------------------------------------------------------------------
- 使用非类型的 Report 组件 (通过文本路径和 ReportDocument reportdocument1)
Dim reportdocument1 As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
reportdocument1.Load("C:\Crystal\crnet\vbnet_win_simplepreviewreport\World Sales Report.rpt")
CrystalReportViewer1.ReportSource = reportdocument1
'--------------------------------------------------------------------
- 使用 Report 对象 (通过已添加到项目的报表文件,如:World Sales Report.rpt)
CrystalReportViewer1.ReportSource = New World_Sales_Report()
'--------------------------------------------------------------------
- 使用强类型的 Report 组件()(通过 ReportDocument world_Sales_Report1)
CrystalReportViewer1.ReportSource = world_Sales_Report1




相关文章

相关软件