2017-10-11 8 views
0

Windows 응용 프로그램에서 Crystal Reports 14.2.2.1975를 Visual Studio 2015와 함께 사용하고 있습니다.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 

은 .. . 문제는 사라집니다.