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.CreateHTMLFo rmatOption s()
'Dim diskOpts As DiskFileDestinationOptions = ExportOptions.CreateDiskFi leDestinat ionOptions ()
'Dim exportOpts As New ExportOptions()
'Dim file As String
'file = theFilePath & theFileName & ".html"
'htmlOpts.HTMLFileName = File
'htmlOpts.HTMLEnableSepara tedPages = False
'htmlOpts.HTMLHasPageNavig ator = False
'exportOpts.ExportFormatOp tions = htmlOpts
'diskOpts.DiskFileName = File
'exportOpts.ExportDestinat ionOptions = diskOpts
'exportOpts.ExportDestinat ionType = _
' ExportDestinationType.Disk File
'exportOpts.ExportFormatTy pe = _
' ExportFormatType.HTML32
'Me.Export(exportOpts)
How do I export the HTML file to a folder other than the "HTML32Folder" & "TheNameoftheReport" path? Thank you.
'Dim htmlOpts As HTMLFormatOptions = ExportOptions.CreateHTMLFo
'Dim diskOpts As DiskFileDestinationOptions
'Dim exportOpts As New ExportOptions()
'Dim file As String
'file = theFilePath & theFileName & ".html"
'htmlOpts.HTMLFileName = File
'htmlOpts.HTMLEnableSepara
'htmlOpts.HTMLHasPageNavig
'exportOpts.ExportFormatOp
'diskOpts.DiskFileName = File
'exportOpts.ExportDestinat
'exportOpts.ExportDestinat
' ExportDestinationType.Disk
'exportOpts.ExportFormatTy
' ExportFormatType.HTML32
'Me.Export(exportOpts)
How do I export the HTML file to a folder other than the "HTML32Folder" & "TheNameoftheReport" path? Thank you.
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you, this worked.
diskOpts.DiskFileName = 'C:\MyDirectory\MyReports\
mlmcc