2017-07-12 77 views
-1

VB.NetでCR 13を使用してレポートを作成しています。Crystal Report - レポートにデータが表示されないが、データセットにデータがある

テストすると、データセットにデータがあるにもかかわらず、レポートにデータが表示されません。

エラーがスローされず、データのない空のテンプレートが表示されます。

ありがとうございました。

更新済み

ここにコードがあります。

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() 

答えて

0

コードを提供していないので、データセットソースを埋め込んだ後でCrystalレポートインスタンスをリフレッシュしないと仮定しています。最後にこれを試してみてください:

CrystalReport.Refresh() 
+0

申し訳ありません、コードを入力するのを忘れて、私はそれを更新しました。ありがとうございました。 –

関連する問題