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 
|