Hello,
I still have this problem when I try to export a crystal report to a pdf file in Visual Basic.net 2003.
here is my code:
Code:Dim crReportDocument As ReportDocument Dim crExportOptions As ExportOptions Dim crDiskFileDestinationOptions As DiskFileDestinationOptions Dim exportFilePath As String = "C:\" + Format(Now, "yyMMdd") + ".pdf" If Dir(exportFilePath) <> "" Then Kill(exportFilePath) End If 'Create an instance of the Chart report crReportDocument = New rptReportDS ''Set the options for saving the exported file to disk crDiskFileDestinationOptions = New DiskFileDestinationOptions crDiskFileDestinationOptions.DiskFileName = exportFilePath 'Set the exporting information crExportOptions = crReportDocument.ExportOptions With crExportOptions .DestinationOptions = crDiskFileDestinationOptions .ExportDestinationType = ExportDestinationType.DiskFile .ExportFormatType = ExportFormatType.PortableDocFormat End With Dim rpt As New rptReportDS 'Nombre del Reporte. Dim myConnection As SqlClient.SqlConnection Dim MyCommand As New SqlClient.SqlCommand Dim myDA As New SqlClient.SqlDataAdapter Dim myDS As New DataSet1 ' Me.daHistPorFechas.SelectCommand.Parameters("@Fecha1").Value = Fecha1 myDA.SelectCommand = MyCommand Me.SqlDataAdapter1.Fill(Me.DataSet11) ' Llena el Reporte. rpt.SetDataSource(Me.DataSet11) CrystalDecisions.Shared.ConnectionInfo crReportDocument.SetDatabaseLogon("ACHReader", "ACHReader", "GDB03SQL", "ACHReader") crReportDocument.Export()
Thanks for suggestions,
Ed




Reply With Quote