使用5種不同的方法載入水晶報表(Windows 表單)

來源:互聯網
上載者:User

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.