Topic: Export Crystal Report Problem Posted: 09 Nov 2011 at 11:34pm
Here is my code to Exports crystal reports in PDF format but there is a problem i want to import and save file by specifying a location.
By default it Exports the file in to C drive
i.e i want to open dialog box and save file how to achieve this please help me.
Try Dim CrExportOptions As ExportOptions Dim CrDiskFileDestinationOptions As New _ DiskFileDestinationOptions() Dim CrFormatTypeOptions As New PdfRtfWordFormatOptions() CrDiskFileDestinationOptions.DiskFileName = _ "c:\crystalExport.pdf" CrExportOptions = rpt.ExportOptions With CrExportOptions .ExportDestinationType = ExportDestinationType.DiskFile .ExportFormatType = ExportFormatType.PortableDocFormat .DestinationOptions = CrDiskFileDestinationOptions .FormatOptions = CrFormatTypeOptions End With rpt.Export() MessageBox.Show("PDF Report has been Generated Succussfully", "SUCCESS", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) Catch ex As Exception MsgBox(ex.ToString) End Try End Sub
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 10 Nov 2011 at 6:32am
you are setting the path to c:\ in the DiskFileName
change it to where you want to save it, or use a SaveFileDialog and have the user select it and append on the report name (or let them select that as well).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum