0

我正在尝试将 Crystal Report 导出到 HTML 文件,但是当我调用 Export 方法时,我立即收到此错误:

来源:水晶报表 ActiveX 设计器

说明:无法导出报告。

我已尝试将 crEFTHTML40 和 crEFTHTML32Standard 作为导出格式类型 - 两者都导致相同的错误。

这是我正在做的一个高度简化的版本:

Dim objCRReport As CRAXDRT.Report
[...]
objCRReport.ExportOptions.FormatType = 32 'crEFTHTML40
objCRReport.ExportOptions.DestinationType = 1 'crEDTDiskFile
objCRReport.ExportOptions.DiskFileName = "C:\reportInHtmlFormat.html"
objCRReport.Export False '<--- "Failed to export the report" error here

请注意,我专门引用了“Crystal Reports 9 ActiveX Designer 运行时库”。

4

2 回答 2

1

我不确定您在该[...]部分中的内容,但您的代码应包含使用 CRAXDRT 应用程序实例打开报告的调用。

Dim objCRReport As CRAXDRT.Report

'***********************************
Dim objCRApp As New CRAXDRT.Application

objCRReport = objCRApp.OpenReport("<YOUR REPORT FILENAME>", 1)
'***********************************

[...]
objCRReport.ExportOptions.FormatType = 32 'crEFTHTML40
objCRReport.ExportOptions.DestinationType = 1 'crEDTDiskFile
objCRReport.ExportOptions.DiskFileName = "C:\reportInHtmlFormat.html"
objCRReport.Export False '<--- "Failed to export the report" error here
于 2008-11-06T18:15:11.383 回答
0

尝试设置HTMLFileName选项:

objCRReport.ExportOptions.HTMLFileName = "C:\reportInHtmlFormat.html"
于 2010-01-27T19:16:20.530 回答