【问题标题】:Crystal Report - Data not showing on report but has data in datasetCrystal Report - 数据未显示在报表上,但数据集中有数据
【发布时间】: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


    【解决方案1】:

    由于您没有提供代码,我假设您在使用数据集源填充水晶报表实例后没有刷新它。最后试试这个:

    CrystalReport.Refresh()
    

    【讨论】:

    • 对不起,忘记放代码了,我刚刚更新了。谢谢。
    猜你喜欢
    • 1970-01-01
    • 2023-03-21
    • 1970-01-01
    • 2013-04-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多