SAP Knowledge Base Article - Public

1705093 - Using InsertPageBreaks API does not result in page breaks when exporting to RTF

Symptom

  • Exporting to Rich Text Format using the following code:
Dim crReportDocument As New ReportDocument
Dim crExportOptions As New ExportOptions
Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
Dim myExportFormatOptions As EditableRTFExportFormatOptions = ExportOptions.CreateEditableRTFExportFormatOptions()

    crReportDocument.Load("C:\Crystal\report1.rpt")
    ''Set the options for saving the exported file to disk
    crDiskFileDestinationOptions = New DiskFileDestinationOptions()
    ' crDiskFileDestinationOptions.DiskFileName = "C:\Crystal\break64.rtf"
    crDiskFileDestinationOptions.DiskFileName = "C:\Crystal\break32.rtf"
    ''Set the exporting information
    crExportOptions = crReportDocument.ExportOptions
    myExportFormatOptions.UsePageRange = False
    myExportFormatOptions.InsertPageBreaks = True
    With crExportOptions
         .ExportFormatOptions = myExportFormatOptions
         .DestinationOptions = crDiskFileDestinationOptions
         .ExportDestinationType = ExportDestinationType.DiskFile
         .ExportFormatType = ExportFormatType.EditableRTF
    End With
     
    ''Export the report
    crReportDocument.Export()
    MsgBox("done")
  • Application compiled as 32 bit inserts page breaks as expected
  • Application compiled as 64 bit does not insert page breaks

Environment

  • Crystal Reports for Visual Studio 2010
  • Visual Studio 2010

Cause

  • The issue has been escalated for a fix
  • Reference number; ADAPT01628595

Resolution

  • Suggested work-around:

In the Crystal Reports designer, under the File Menu -> Export -> Report Export Options, select "Microsoft Word (97-2003) - Editable" and press "OK". Enable the "Insert page break after each report page" option and save the report.

 

Keywords

CR2010 2010 CR4VS2010 CR4VS VS2010 NET2010 Crystal Reports for .NET Framework 4.0 crforvs 13 rich text format formatting , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , Bug Filed

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio