Invalid Export Options error when exporting a crystal report 
Author Message
 Invalid Export Options error when exporting a crystal report

Hi,

I've got a very weird problem when trying to export a Crystal Report.
Let me explain the application structure first because it is important
to understand what the real problem is:

an ASP page <-> a VB COM component <-> a .NET C# component interop as
a COM.

The .NET component uses the Crystal Report Engine to generate a report
and export it as a HTML file whose name will be fed to the ASP page as
a link, the next time when the link is clicked, the report will be
shown.

There are two types of reports defined: a plain one and a fancy one
with a couple of nice colour charts.

Now here is the weird thing:

1. I was able to get the plain report shown but when I let program to
create the fancy report, I always got "Invalid Export Options" error
from the report engine.

2. I've developed a test program to run the .NET C# component, it was
able to generate any report in the HTML format with no problem at all.

3. Both types of report actually used the exact same code (except the
different report templates and the datasets)

4. To make things more interesting, if I ran the VB component in a
debug mode (Yes, the one which had nothing to do with the report
generation), everything worked perfectly.

I think I could rule out the following:

1. It's not a security problem as one report works and the other
doesn't

2. I would doubt if it is a code problem as, again, both reports share
the same code, in addition, the test program was able to run the
report, so was in the debug mode.

I will appreciate if somebody could help me out as I am completely
puzzled.

Here is the code:

HTMLFormatOptions htmlFormatOptions;
DiskFileDestinationOptions fileOptions;
ExportOptions exportOptions;
ReportDocument report;


htmlFormatOptions = new HTMLFormatOptions();



htmlFormatOptions.HTMLEnableSeparatedPages = true;
htmlFormatOptions.HTMLHasPageNavigator = true;
htmlFormatOptions.FirstPageNumber = 1;

report = new ReportDocument();

exportOptions = new ExportOptions();                    
exportOptions = report.ExportOptions;
exportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
exportOptions.ExportFormatType = ExportFormatType.HTML40;
exportOptions.FormatOptions = htmlFormatOptions;

// dbReportData is the dataset passed in
report.SetDataSource(dbReportData);

try
{
        report.Export();
        this.ready = true;

Quote:
}

catch (Exception e)
{
        throw;
Quote:
}

finally
{
        report.Close();
Quote:
}



Sun, 24 Jul 2005 16:08:25 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Crystal Report Export Error

2. help:crystal report 8.5 error out date export dll

3. Crystal Reports - Exporting error - Missing or Out-of-date DLL

4. Error Exporting Crystal Reports and Filtering Records

5. NullReferenceException Error when Exporting Crystal Report

6. Crystal Report in .NET - Logon Failed Error while Exporting

7. Crystal Reports export error

8. Export Error in Crystal Reports .net

9. export report in crystal report 7.0

10. TO EXPORT A CRYSTAL REPORTS REPORT TO EXCEL

11. To Export a Crystal Reports report to Excel

12. Report Export Options

 

 
Powered by phpBB® Forum Software