crystal reports exception help

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Lousy help in msdn. What would cause a "Invalid export options."
exception in a windows forms app using ExportFormatType.HTML40?


report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.HTML40,
"rpt1.htm");




Details:

CrystalDecisions.CrystalReports.Engine.InvalidArgumentException was
unhandled
Message="Invalid export options."
Source="CrystalDecisions.Shared"
StackTrace:
at
CrystalDecisions.CrystalReports.Engine.EngineExceptionUtils.DoThrowException(String
message, EngineExceptionErrorID id)
at
CrystalDecisions.CrystalReports.Engine.ExceptionThrower.ThrowEngineException(String
messageID, EngineExceptionErrorID id)
at
CrystalDecisions.CrystalReports.Engine.HTMLExporter.GetPage(Boolean
bSeparatePages, Boolean bDHTML, Int32 startPage, Int32 endPage)
at CrystalDecisions.CrystalReports.Engine.HTMLExporter.Export()
at ...
 
Paul said:
Lousy help in msdn. What would cause a "Invalid export options."
exception in a windows forms app using ExportFormatType.HTML40?


report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.HTML40,
"rpt1.htm");




Details:

CrystalDecisions.CrystalReports.Engine.InvalidArgumentException was
unhandled
Message="Invalid export options."
Source="CrystalDecisions.Shared"
StackTrace:
at
CrystalDecisions.CrystalReports.Engine.EngineExceptionUtils.DoThrowException(String
message, EngineExceptionErrorID id)
at
CrystalDecisions.CrystalReports.Engine.ExceptionThrower.ThrowEngineException(String
messageID, EngineExceptionErrorID id)
at
CrystalDecisions.CrystalReports.Engine.HTMLExporter.GetPage(Boolean
bSeparatePages, Boolean bDHTML, Int32 startPage, Int32 endPage)
at CrystalDecisions.CrystalReports.Engine.HTMLExporter.Export()
at ...

Yes, the doc on MSDN for Crystal Reports class hierarchy truly and
profoundly sucks.

You might try asking in microsoft.public.vb.crystal. It's a
lower-traffic group, but more Crystal gurus hang out there.
 
Yes, the doc on MSDN for Crystal Reports class hierarchy truly and
profoundly sucks.

You might try asking in microsoft.public.vb.crystal. It's a
lower-traffic group, but more Crystal gurus hang out there.
If it weren't for google groups you couldn't even program with visual
studio due to incomplete documentation. Just for the google groups, here
is what I came up with to get it to work. I had to experiment a bit due
to the poor documentation and non-working(!) samples they give you.

CrystalReport1 report = new CrystalReport1();

CrystalDecisions.Shared.ExportOptions options = new
CrystalDecisions.Shared.ExportOptions();

DiskFileDestinationOptions diskOpts =
ExportOptions.CreateDiskFileDestinationOptions();

ExportOptions exportOpts = new ExportOptions();
exportOpts.ExportFormatType = ExportFormatType.HTML40;
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;

exportOpts.ExportDestinationOptions = diskOpts;

HTMLFormatOptions htmlFormatOpts = new HTMLFormatOptions();
htmlFormatOpts.FirstPageNumber = 1;
htmlFormatOpts.HTMLBaseFolderName = "reports";
htmlFormatOpts.HTMLFileName = "test.htm";
htmlFormatOpts.HTMLHasPageNavigator = true;

exportOpts.ExportFormatOptions = htmlFormatOpts;

report.Export(exportOpts);
 
Hi,

I got it working by copying the folder from wwwroot directory and put into a different directory like c:\ then recreate the virtual directory. But i dont want to do it this way coz it needs manual intervention.

Does anyone solved this problem using a deployment package. I got this error when exporting to HTML.

I've already done the solution provided here,like copying the msvcp60.dll both in the c:\windows\system32 and application_folder\bin folder.

Thanks in advance.

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
Back
Top