Can't get crystal to export a report when using ExportFormatType.HTML40 
Author Message
 Can't get crystal to export a report when using ExportFormatType.HTML40

I have tried to export a report to html by using the following code:

        ' Declare variables and retrieve the export options.
        Dim htmlOpts As New HTMLFormatOptions()
        Dim exportOpts As New ExportOptions()
        Dim diskOpts As New DiskFileDestinationOptions()

        ' Set the HTML format options.
        htmlOpts.HTMLFileName = File
        htmlOpts.HTMLEnableSeparatedPages = seperatePages
        htmlOpts.HTMLHasPageNavigator = pageNavigator
        Report.ExportOptions.FormatOptions = htmlOpts

        ' With HTML the destination options need to be set also.
        diskOpts.DiskFileName = Server.MapPath(destinationPath & "/" &
File)
        Report.ExportOptions.DestinationOptions = diskOpts

        ' Export the report.
        Report.ExportOptions.ExportDestinationType =
ExportDestinationType.DiskFile
        Report.ExportOptions.ExportFormatType =
ExportFormatType.HTML40

        Report.Export()

----------------------

It never works. I have got all other formats(pdf, excel, word, etc) to
work, but not the HTML.

The error generated is:
"Invalid export options"

Please help!!
/Patrik



Mon, 21 Feb 2005 14:13:44 GMT  
 Can't get crystal to export a report when using ExportFormatType.HTML40
Did you define ExportFormatType.HTML40 yourself?

The predefined constant I use would be crEFTHTML40, and its actual value is
32.


Quote:
> I have tried to export a report to html by using the following code:

>         ' Declare variables and retrieve the export options.
>         Dim htmlOpts As New HTMLFormatOptions()
>         Dim exportOpts As New ExportOptions()
>         Dim diskOpts As New DiskFileDestinationOptions()

>         ' Set the HTML format options.
>         htmlOpts.HTMLFileName = File
>         htmlOpts.HTMLEnableSeparatedPages = seperatePages
>         htmlOpts.HTMLHasPageNavigator = pageNavigator
>         Report.ExportOptions.FormatOptions = htmlOpts

>         ' With HTML the destination options need to be set also.
>         diskOpts.DiskFileName = Server.MapPath(destinationPath & "/" &
> File)
>         Report.ExportOptions.DestinationOptions = diskOpts

>         ' Export the report.
>         Report.ExportOptions.ExportDestinationType =
> ExportDestinationType.DiskFile
>         Report.ExportOptions.ExportFormatType =
> ExportFormatType.HTML40

>         Report.Export()

> ----------------------

> It never works. I have got all other formats(pdf, excel, word, etc) to
> work, but not the HTML.

> The error generated is:
> "Invalid export options"

> Please help!!
> /Patrik



Mon, 21 Feb 2005 15:13:14 GMT  
 Can't get crystal to export a report when using ExportFormatType.HTML40
For HTML export you want to provide a directory name, not a file name, since
the CRPE32.DLL print engine has to make multiple files for each page and
each jpg in the report.  If you provide a file name that is not an existing
directory name, the report will fail to export.


Quote:
> I have tried to export a report to html by using the following code:

>         ' Declare variables and retrieve the export options.
>         Dim htmlOpts As New HTMLFormatOptions()
>         Dim exportOpts As New ExportOptions()
>         Dim diskOpts As New DiskFileDestinationOptions()

>         ' Set the HTML format options.
>         htmlOpts.HTMLFileName = File
>         htmlOpts.HTMLEnableSeparatedPages = seperatePages
>         htmlOpts.HTMLHasPageNavigator = pageNavigator
>         Report.ExportOptions.FormatOptions = htmlOpts

>         ' With HTML the destination options need to be set also.
>         diskOpts.DiskFileName = Server.MapPath(destinationPath & "/" &
> File)
>         Report.ExportOptions.DestinationOptions = diskOpts

>         ' Export the report.
>         Report.ExportOptions.ExportDestinationType =
> ExportDestinationType.DiskFile
>         Report.ExportOptions.ExportFormatType =
> ExportFormatType.HTML40

>         Report.Export()

> ----------------------

> It never works. I have got all other formats(pdf, excel, word, etc) to
> work, but not the HTML.

> The error generated is:
> "Invalid export options"

> Please help!!
> /Patrik



Fri, 25 Feb 2005 07:39:14 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Crystal Reports Canned Code

2. Using an existing crystal report, but programmatically redirecting where/how the report gets its data

3. Exporting from Crystal Reports 9's Interactive Viewer

4. How to export to Html using Crystal's VB activeX

5. Print and Export button in Crystal Report View not using SelectionFormula

6. Problem using Crystal Report 8.5 to export PDF in Visual Basic 6.0

7. Export Crystal Report using RDC

8. using RDC to export Crystal Reports - Parametes?

9. Export reports to HTML using Crystal 8.

10. Exporting to HTML using the Version of Crystal Reports that Comes with VB 4.0 Pro

11. EXPORTING CRYSTAL REPORT TO A DISK USING VB !!!!

12. Invalid Export Options error when exporting a crystal report

 

 
Powered by phpBB® Forum Software