Ich versuche, meinen Crystal Reports-Bericht in das PDF-Format zu exportieren, erhalte aber weiterhin den Fehler "Fehler beim Öffnen einer Verbindung". Es scheint, als ob der Fehler in der Zeile CR.Export passiert. Ich habe alles versucht, weiß aber nicht, wie ich es beheben kann. Zu Ihrer Information, es funktioniert auf meinem Entwicklungsserver, aber wenn ich es auf den Produktionsserver kopiere, erhalte ich den Fehler. Es ist also sehr schwer festzustellen, wo es auftritt.Fehler beim Öffnen der Verbindung beim Exportieren des Crystal-Reports-Berichts
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
Try
InitializeComponent()
strPermitNo = Session("RecordID")
SpWithViewer(strPermitNo)
CrystalReportViewer2.DataBind()
Catch er As Exception
LogError(er.ToString, "PageInit-PrintPermit1.aspx")
Exit Try
Finally
End Try
End Sub
` Protected Sub btnExport_Click (Absender als Gegenstand, e As EventArgs) Griffe btnExport.Click
strPermitNo = Session("RecordID")
Try
Dim CrExportOptions As ExportOptions
Dim CrDiskFileDestinationOptions As New DiskFileDestinationOptions()
Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions()
CrDiskFileDestinationOptions.DiskFileName = "\\idsfmsrvr\wwwroot\FWPDFs\" & strPermitNo & ".pdf"
strAttachment = "\\idsfmsrvr\wwwroot\FWPDFs\" & strPermitNo & ".pdf"
Session("Attachment") = strAttachment
CrExportOptions = CR.ExportOptions
If True Then
CrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
CrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat
CrExportOptions.DestinationOptions = CrDiskFileDestinationOptions
CrExportOptions.FormatOptions = CrFormatTypeOptions
End If
CR.Export()
EmailPermitToApplicant()
File.Delete(strAttachment)
lblMsg.Text = "Permit has been emailed to applicant."
lblMsg.Visible = True
Catch er As Exception
LogError(er.ToString, "btnExport()-PrintPermit1.aspx")
Exit Try
Finally
connFTS.Close()
End Try`
Können Sie hier den genauen Fehler anzeigen? –