0

我有许多水晶报表,我要在 vb.net 中导出为文本。它导出得很好,但都作为一页 - 没有分页符或页面标题。我可以通过将位更改为其他内容来更改这FormatOptions.LinesPerPage = 0一点,但是导出的报告都是不同的。对一个人有用的东西不一定对另一个人有用。我宁愿不必为每个报告单独编写代码。

有没有办法将 Crystal Reports 分页符传递给导出文本?或另一种格式(例如,.pdf?)

Dim crReportDocument As New ReportDocument
Dim ExportOpts As New ExportOptions
Dim DestinationOptions As New DiskFileDestinationOptions()
Dim FormatOptions As New TextFormatOptions

crReportDocument.Load(strFileName)
ExportOpts = crReportDocument.ExportOptions

DestinationOptions.DiskFileName = strNewFileName
FormatOptions.CharactersPerInch = 16
FormatOptions.LinesPerPage = 0
With ExportOpts
    .ExportDestinationType = ExportDestinationType.DiskFile
    .ExportFormatType = ExportFormatType.Text
    .DestinationOptions = DestinationOptions
    .ExportFormatOptions = FormatOptions
End With

crReportDocument.Export(ExportOpts)
crReportDocument.Close()
crReportDocument.Dispose()
4

0 回答 0