Symptom
- Running a report formatted to export to PDF with bookmarks in a Visual Studio .NET application, the bookmark looks as:
Reportname{01CECC69-CA18-4358-BC4E-95DD4DED7DDD}.rpt
Environment
- SAP Crystal Reports, developer version for Microsoft Visual Studio
- Microsoft Visual Studio (2010 / 2012)
Reproducing the Issue
- Open a report in the Crystal Reports designer
- Go to the File menu and select Export and Report Export Options
- Select PDF from the drop down menu and click the OK button
- Select the option "Create bookmarks from group tree" in the "Export options" dialog and click OK
- Save the report
- When this report is exported to PDF, the bookmark will display the name of the report in the Bookmarks section
- Exporting this same report from a Visual Studio .NET application results in the name displaying as;
Reportname{01CECC69-CA18-4358-BC4E-95DD4DED7DDD}.rpt
Resolution
- Open the report in the Crystal reports designer
- Go to the File menu and select "Summary Info"
- Type in the report name in the "Title" text box
- Save the report
- This report will now display the Bookmark as the report name, as it does in the Crystal Reports designer
- Solution using CR SDK for .NET:
Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim exportFilePath As String = Application.StartupPath + "\exported.pdf"
Dim myExportOpts As New ExportOptions
Dim diskOpts As DiskFileDestinationOptions
diskOpts = ExportOptions.CreateDiskFileDestinationOptions()
Dim pdfOptions As CrystalDecisions.Shared.PdfFormatOptions = New PdfFormatOptions()crReportDocument.Load("C:\tests\Drill Down Group Level.rpt")
crReportDocument.SummaryInfo.ReportTitle = "Hello World"myExportOpts.ExportFormatType = ExportFormatType.PortableDocFormat
myExportOpts.ExportDestinationType = ExportDestinationType.DiskFile
myExportOpts.ExportDestinationOptions = diskOpts
diskOpts.DiskFileName = exportFilePath
pdfOptions.CreateBookmarksFromGroupTree = True''Export the report
crReportDocument.Export(myExportOpts)''Display a message letting the user know the export is complete
MessageBox.Show("Report exported to: '" & exportFilePath & "'")
Keywords
book mark vs net crvs adobe , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To
Product
Crystal Reports 2008 V1 ; SAP Crystal Reports, developer version for Microsoft Visual Studio