Link to home
Start Free TrialLog in
Avatar of KMBrochu
KMBrochu

asked on

How to export HTML from Crystal report to a different file path than specified by Crystal

I am exporting an HTML file from VS2005 using the Crystal that ships with VS2005.  If I follow the documentation provided by Crystal, the files get exported to a folder called "HTML32Folder" & "TheNameoftheReport".  If I do not use the "HTML32Folder" file path, the file gets written to the visual studio project path.  I have tried the code on the MSDN site, and that also exports it to the project path.  This is the code that MSDN has, but the file always goes to the visual studio project path:
'Dim htmlOpts As HTMLFormatOptions = ExportOptions.CreateHTMLFormatOptions()
        'Dim diskOpts As DiskFileDestinationOptions = ExportOptions.CreateDiskFileDestinationOptions()
        'Dim exportOpts As New ExportOptions()
        'Dim file As String
        'file = theFilePath & theFileName & ".html"

        'htmlOpts.HTMLFileName = File
        'htmlOpts.HTMLEnableSeparatedPages = False
        'htmlOpts.HTMLHasPageNavigator = False
        'exportOpts.ExportFormatOptions = htmlOpts

        'diskOpts.DiskFileName = File
        'exportOpts.ExportDestinationOptions = diskOpts

        'exportOpts.ExportDestinationType = _
        '   ExportDestinationType.DiskFile
        'exportOpts.ExportFormatType = _
        '   ExportFormatType.HTML32

        'Me.Export(exportOpts)

How do I export the HTML file to a folder other than the "HTML32Folder" & "TheNameoftheReport" path?  Thank you.
Avatar of Mike McCracken
Mike McCracken

Have you tried using

diskOpts.DiskFileName = 'C:\MyDirectory\MyReports\Exported\MyReport.html'

mlmcc
Avatar of KMBrochu

ASKER

Yes, it will still put the file in the project directory.
I assume you removed the ' from the front of the code.  Otherwise they are comments.

According to this document that is the line to change.  Export starts on page 191

http://www.businessobjects.com/global/pdf/dev_zone/VS2005_Walkthroughs.pdf

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of VBRocks
VBRocks
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you, this worked.