Results 1 to 4 of 4

Thread: how to change the filename when export button is clicked

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2005
    Posts
    1

    how to change the filename when export button is clicked

    hi,

    does anyone here knows how can i specify my own filename when a user clicks on the export button? it always defaults to the filename of the report that i'm using.

    or do i need to create my own exporting module?

    thanks in advance.

    ann

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: how to change the filename when export button is clicked

    Welcome to the forums.

    Creating your own export module would probably be better as you would have total control over what happened. What do you want to export it to?

  3. #3
    Junior Member
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    22

    Re: how to change the filename when export button is clicked

    So there is no way to provide a default filename for the export functionality other than writing a custom pdf export module from ground up?

    My situation: The user would like the application to provide a default filename in the export dialog (i.e. where you specify the filename and location) so they don't have to type it in everytime.

    Any help would be greatly appreciated.

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: how to change the filename when export button is clicked

    The Report Viewer Control lets you over-ride any of its default processing.

    A few lines of code is all you need.

    VB Code:
    1. Private Sub rptViewer_ExportButtonClicked(UseDefault As Boolean)
    2.     Dim objReport As CRAXDRT.Report
    3.        
    4.     Set objReport = rptViewer.ReportSource
    5.     With objReport.ExportOptions
    6.         .DestinationType = crEDTDiskFile
    7.         .FormatType = crEFTPortableDocFormat
    8.         .PDFExportAllPages = True
    9.  
    10.         'Using a Common Dialog control you could
    11.         'prompt the user for the file name/location
    12.         .DiskFileName = "c:\blah.pdf"
    13.  
    14.     End With
    15.    
    16.     objReport.Export False
    17.     UseDefault = False
    18.  
    19. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width