首页 文章

Crystal Reports子报表中缺少数据

提问于
浏览
0

我收集了一些子报告 . 每个代码几乎完全相同(我喜欢模式) . 这是一个失败的样本:

' subject
    sql = "select * from vw_UORSuspect where offense_id = " + offenseID.ToString
    GetData(sql, dsUORSubject, "vw_uorSubject", 0)
    If Not dsUORSubject.Tables(0).Rows.Count = 0 Then
        mySection = UORrpt.ReportDefinition.Sections("DetailSection6")
        mySubObj = mySection.ReportObjects("Subreport3")
        mySubRep = mySubObj.OpenSubreport(mySubObj.SubreportName)
        mySubRep.SetDataSource(dsUORSubject)
        'mySubSection = UORrpt.Subreports.Item(0).ReportDefinition.Sections(1)
    End If

这很直接 . 我加载我的数据集对象,测试是否有数据,然后将其填入报告子部分 . 数据确实被加载到数据集中,这很容易查看 .

数据集中有两条记录,因为前一个子报表按预期显示 .

1 回答

  • 0

    原来这是视图名称中的拼写错误的结果,因为您可以看到是否查看了名称 . 有人看着我的肩膀让我看到它 .

相关问题