Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Export Crystal Report Problem Post Reply Post New Topic
Author Message
Naveed_786
Newbie
Newbie


Joined: 20 Oct 2011
Location: Pakistan
Online Status: Offline
Posts: 13
Quote Naveed_786 Replybullet 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

Edited by Naveed_786 - 09 Nov 2011 at 11:35pm
Some Thing is Better Than Nothing
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet 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).
IP IP Logged
Printable version Printable version

Forum Jump
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