Dim cryRpt As New ReportDocument
Dim strReportPath As String = 'The Path of the rpt file
cryRpt.Load(strReportPath)
cryRpt.SetDataSource(Me.crData) 'crData is a datatable with data for the report
crvReport.ReportSource = cryRpt 'crvReport is the CrystalReportViewer in my form
3 回答
这是我的一个代码片段(在C#中,但应该让你知道我是如何做到的):
虽然你说你正在使用设计师,但我会发布一些对我有用的代码,也许它会对你有所帮助:
在“SetDataSource”中设置时,检查数据中是否存在所有字段