【发布时间】:2017-07-12 07:51:11
【问题描述】:
我正在 VB.Net 中使用 CR 13 创建报告。
测试时,即使数据集中有数据,报告中也没有显示数据。
没有抛出任何错误,它只是显示一个没有数据的空白模板。
谢谢。
更新
这里是代码。
Dim dt As New DataTable
m_ReportClass = New CustomReports
With ctrlRptViewer
dt = m_ReportClass.GetDOSRI(entityID, reportDate, isConsolidated)
Dim isHeadOffice As Boolean = False
isHeadOffice = (Current.Entity.Code.Count = 4)
.ReportTitle = "xxxx"
.ReportParams = {
"report_header1=" & IIf(Not isHeadOffice, Current.Entity.Name, ctrlEntity.NameEntity) & " - DOSRI REPORT",
"report_header2=FOR THE MONTH OF " & MonthName(Month(dtpDate.Value)) & " " & Year(dtpDate.Value)
}
.ReportData = dt
If isConsolidated Then
.ReportFile = REPORTS_PATH & "\x\y.rpt"
Else
.ReportFile = REPORTS_PATH & "\x\y.rpt"
End If
.ShowReport()
End With
对于 ShowReport 方法。
DisposeReportSource()
If ReportFile <> "" Then
ReportSource = New ReportDocument
ReportSource.Load(ReportFile, CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault)
SetDataSource(ReportSource, ReportData, ReportTitle, ReportParams)
Else
SetDataSource(ReportSource, ReportTitle, ReportParams)
End If
crvViewer.ReportSource = ReportSource
crvViewer.Refresh()
【问题讨论】:
标签: vb.net printing crystal-reports