2017-10-11 7 views
0

WindowsアプリケーションでVisual Studio 2015でCrystal Reports 14.2.2.1975を使用しています。Crystal Reports:ビューアでページを表示またはリフレッシュできません。

DataTableに一致するフィールド定義に基づいてレポートを正常に作成できました。レポートは完全に印刷され、正しくプレビューされますが、ビューアでリフレッシュまたはページングコントロールを使用しようとすると、レポートパラメータが再度表示され、要求されたページの代わりにサンプルデータが表示されます。

ビューアを設定するコードは、別のダイアログフォーム(FrmPrint)から呼び出されます。

frmReportPreview.Show() ' A modeless dialog 

に変更:FrmPrintの "プレビュー" ボタンで関連するコードは、それが判明

Dim crxReport As New ReportDocument 
crxReport.Load("<path>\Sample Report.rpt") 

... 

<a dataTable (dt) is created and loaded with the proper data> 

... 


' Set the data source of the report to that dataTable 
crxReport.Database.Tables(0).SetDataSource(dt) 

' Prepare to preview the report 
(viewer contained on a separate form, "FrmReportPreview") 
With FrmReportPreview 
    .Text = "My report name" 
    .CrystalReportViewer1.ReuseParameterValuesOnRefresh = True 
    .CrystalReportViewer1.ReportSource = crxReport 
    .CrystalReportViewer1.Show() 
End With 

' Show the report preview window 
FrmReportPreview.Show() 

答えて

0

の問題は、最終的なラインだった...ある

frmReportPreview.ShowDialog() ' Making it modal 

は...問題は消え去る。

関連する問題