0

데이터 세트과 테이블 ("DataTable1")을 만든 다음 해당 데이터 세트를 사용하여 Crystal Report를 만들고 코드 세트의 DataSet 소스를 설정했습니다.인쇄 및 내보내기 버튼이 Crystal Report의 로그인 데이터베이스 서버로 리디렉션됩니다.

 Dim dt As DataTable 
     dt = businessService.GetEmpDetails(SetDBSchema()) 
     dt.TableName = "DataTable1" 

     Dim Report As ReportDocument = New ReportDocument() 
     Report.Load(Server.MapPath("EvaluationReport.rpt")) 
     Report.Database.Tables("DataTable1").SetDataSource(dt) 
     CrystalReportViewer1.ReportSource = Report 
     CrystalReportViewer1.RefreshReport() 

     Report.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, True, "Customers") 

CrystalReportViewer 도구 모음을 사용하여 보고서를 내보내거나 인쇄하려고하면 데이터베이스 서버에 로그인하도록 리디렉션됩니다.

<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" HasExportButton="True" PrintMode="Pdf" AutoDataBind="true" /> 

ExportToHttpResponse not working.

데이터 세트를 코드에 할당했기 때문에 이러한 문제가 발생한다고 생각합니다. 이러한 문제는 어떻게 해결할 수 있습니까?

답변

0

내가 잘못 된 부분이 있습니다. CrystalReportViewer가 업데이트 패널에 있고 업데이트 패널을 제거해도 문제가 없습니다. 대신

0

:

Report.Database.Tables("DataTable1").SetDataSource(dt) 

사용 :

Report.SetDataSource(dt) 

제거 :

CrystalReportViewer1.RefreshReport() 

추가 :

Report.ExportToHttpResponse (ExportFormatType.PortableDocFormat, 응답, 사실, "고객")

추가 : 당신이 다른하는 ASP 버튼이있는 경우

<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" /> 

내보내기 버튼이 필요 당신이 그것을

을 유지할 수 없다
관련 문제